conglu1997 / v-d4rl

Challenges and Opportunities in Offline Reinforcement Learning from Visual Observations
MIT License
94 stars 9 forks source link

AttributeError: 'EfficientReplayBuffer' object has no attribute 'valid' #2

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hello,

The new paper is so inspiring!!

When I ran this command python drqbc/train.py task_name=offline_walker_walk_random offline_dir=vd4rl_data/main/walker_walk/random/84px nstep=3 seed=0, I met an error here:

Error executing job with overrides: ['task_name=offline_walker_walk_random', 'offline_dir=vd4rl_data/main/walker_walk/random/84px', 'nstep=3', 'seed=0']
Traceback (most recent call last):
  File "drqbc/train.py", line 315, in main
    workspace.train_offline(cfg.dataset_dir)
  File "/home/mgz/project/v-d4rl-main/drqbc/train.py", line 283, in train_offline
    metrics = self.agent.update(self.replay_buffer, self.global_step)
  File "/home/mgz/project/v-d4rl-main/drqbc/drqv2.py", line 263, in update
    batch = next(replay_buffer)
  File "/home/mgz/project/v-d4rl-main/drqbc/numpy_replay_buffer.py", line 92, in __next__
    indices = np.random.choice(self.valid.nonzero()[0], size=self.batch_size)
AttributeError: 'EfficientReplayBuffer' object has no attribute 'valid'

I create the environment using drqbc/conda_env.yml without any other change. How can I resolve this issue? Thanks!

conglu1997 commented 2 years ago

Hey, thanks for trying out the code! This means that there was no data found at the path, have you downloaded the data from the google drive?

ghost commented 2 years ago

Thanks for your help! I still have some questions.

  1. Which version of dm-control , tensorflow and torch should I install? I met the error of

    dm-control 1.0.3.post1 requires protobuf>=3.20.1,
    tensorflow 2.9.1 requires protobuf<3.20,>=3.9.2

    My CUDA Version is 11.3.

  2. I current install the mujoco_py==2.0.2.0, mujoco200 and dm_control==1.0.0, and here is an error:

    AttributeError: 'MjData' object has no attribute 'qacc_unc'

    If I cannot use mujoco200?

  3. I downloaded the data and put them as follows, am I right?

    │   └───v-d4rl_main
    │   └───vd4rl_data

Thanks again!!!

conglu1997 commented 2 years ago

Hey! For 1 and 2, I have uploaded new conda_env.yml files that have updated requirements.

For 3, that should be fine, the files can be located anywhere, the directory passed via command line just needs to be changed!

Thanks for raising that, please let me know if you have any further questions! :)

ghost commented 2 years ago

Thank you for responding so quickly. I will try again after my final exams.