carpedm20 / deep-rl-tensorflow

TensorFlow implementation of Deep Reinforcement Learning papers
MIT License
1.59k stars 398 forks source link

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

Open qiyang77 opened 5 years ago

qiyang77 commented 5 years ago

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 commented 5 years ago

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

Yifeng-Peng commented 2 years ago

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