D4RL-Evaluations icon indicating copy to clipboard operation
D4RL-Evaluations copied to clipboard

Issue with running the codes

Open shreyansh26 opened this issue 2 years ago • 1 comments

I was trying to run the AWR algorithm on the HalfCheetah environment as given in the README. So, first of all there is no run.py code in the folder of AWR. I copied run_script.py to the root of AWR folder and rand the command -

python run.py --env HalfCheetah-v2 --max_iter 20000 --visualize

However, I got an error as

Traceback (most recent call last):
  File "run.py", line 96, in <module>
    main(sys.argv)
  File "run.py", line 79, in main
    agent = build_agent(env)
  File "run.py", line 57, in build_agent
    agent = awr_agent.AWRAgent(env=env, sess=sess, **agent_configs)
  File "/Users/shs/Desktop/Projects/Offline RL/d4rl_evaluations/awr/learning/awr_agent.py", line 78, in __init__
    visualize=visualize)
  File "/Users/shs/Desktop/Projects/Offline RL/d4rl_evaluations/awr/learning/rl_agent.py", line 61, in __init__
    self._load_demo_data(self._env)
  File "/Users/shs/Desktop/Projects/Offline RL/d4rl_evaluations/awr/learning/rl_agent.py", line 466, in _load_demo_data
    demo_data = d4rl.qlearning_dataset(env)
  File "/Users/shs/Desktop/Projects/Offline RL/d4rl/d4rl/__init__.py", line 87, in qlearning_dataset
    dataset = env.get_dataset(**kwargs)
  File "/Users/shs/.local/lib/python3.6/site-packages/gym/core.py", line 216, in __getattr__
    return getattr(self.env, name)
AttributeError: 'HalfCheetahEnv' object has no attribute 'get_dataset'

How should I resolve this?

shreyansh26 avatar Jul 29 '21 10:07 shreyansh26