D4RL icon indicating copy to clipboard operation
D4RL copied to clipboard

*** AttributeError: 'HopperEnv' object has no attribute 'get_dataset'

Open HYDesmondLiu opened this issue 3 years ago • 3 comments

Environment: Ubuntu 18.04 / Python 3.8.5 gym==0.18.3 gym-maze==0.4 gym-minigrid==1.0.2 gym3==0.3.3 -e git+https://github.com/rail-berkeley/d4rl.git@9b68f31bab6a8546edfb28ff0bd9d5916c62fd1f#egg=d4rl

I was trying to get dataset for MuJoCo Hopper env. The error messages are pasted below.

 >>> env = gym.make('Hopper-v3')
>>> dataset = env.get_dataset()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/hsinyu/anaconda3/lib/python3.8/site-packages/gym/core.py", line 223, in __getattr__
    return getattr(self.env, name)
AttributeError: 'HopperEnv' object has no attribute 'get_dataset'
>>> dataset = d4rl.qlearning_dataset(env)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data3/hsinyu/00_BRL/BEAR/d4rl/d4rl/__init__.py", line 87, in qlearning_dataset
    dataset = env.get_dataset(**kwargs)
  File "/home/hsinyu/anaconda3/lib/python3.8/site-packages/gym/core.py", line 223, in __getattr__
    return getattr(self.env, name)
AttributeError: 'HopperEnv' object has no attribute 'get_dataset'

HYDesmondLiu avatar Jul 22 '21 02:07 HYDesmondLiu

try to reinstall gym=0.18.0

QuBohao avatar Mar 23 '22 00:03 QuBohao

Hi, I got the same issue for gym==0.18.0. Did you solve it?

YANG1030 avatar Jan 25 '24 18:01 YANG1030

I change import gymnasium as gym to import gym and it works.

MoonOutCloudBack avatar Mar 10 '24 07:03 MoonOutCloudBack