deep-rl-tensorflow icon indicating copy to clipboard operation
deep-rl-tensorflow copied to clipboard

TypeError: __init__() got an unexpected keyword argument 'timestep_limit'

Open qiyang77 opened this issue 6 years ago • 2 comments

Can't train the DQN!, I have installed gym[all] and tensorflow 1.9.0 with python 3.6.8, any idea? $ python main.py --network_header_type=nature --env_name=Breakout-v0 Traceback (most recent call last): File "main.py", line 10, in <module> from environments.environment import ToyEnvironment, AtariEnvironment File "/media/bigdata/Solid2/DQN/deep-rl-tensorflow-master/environments/environment.py", line 6, in <module> from .corridor import CorridorEnv File "/media/bigdata/Solid2/DQN/deep-rl-tensorflow-master/environments/corridor.py", line 131, in <module> timestep_limit=100, File "/home/bigdata/.conda/envs/tensorflow/lib/python3.6/site-packages/gym/envs/registration.py", line 153, in register return registry.register(id, **kwargs) File "/home/bigdata/.conda/envs/tensorflow/lib/python3.6/site-packages/gym/envs/registration.py", line 147, in register self.env_specs[id] = EnvSpec(id, **kwargs) TypeError: __init__() got an unexpected keyword argument 'timestep_limit'

qiyang77 avatar Jun 13 '19 02:06 qiyang77

I have solved this problem by add some code in gym/env/registration.py . It is because the arg 'timestep_limit' has been deprecated https://github.com/openai/gym/commit/4cec14144b2a190e88b346231cb1ba3f5df759c8

qiyang77 avatar Jun 18 '19 02:06 qiyang77

It is solved by replacing timestep_limit to max_episode_steps in init()

Yifeng-Peng avatar Aug 09 '21 09:08 Yifeng-Peng