Farama-Foundation / D4RL

A collection of reference environments for offline reinforcement learning
Apache License 2.0
1.34k stars 286 forks source link

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

Open HYDesmondLiu opened 3 years ago

HYDesmondLiu commented 3 years ago

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'
QuBohao commented 2 years ago

try to reinstall gym=0.18.0

YANG1030 commented 9 months ago

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

MoonOutCloudBack commented 8 months ago

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