simoninithomas / Deep_reinforcement_learning_Course

Implementations from the free course Deep Reinforcement Learning with Tensorflow and PyTorch
http://www.simoninithomas.com/deep-rl-course
3.74k stars 1.23k forks source link

AttributeError: spec missing in TimeLimit wrapper #63

Closed kmcnayr closed 4 years ago

kmcnayr commented 4 years ago

I receive this error when running the PPO play/agent:

/gym/wrappers/time_limit.py", line 10, in init self.env.spec.max_episode_steps = max_episode_steps AttributeError: 'NoneType' object has no attribute 'max_episode_steps'

I narrowed it down to the attribute 'spec' being None in the TimeLimit wrapper.

I can't find a package requirements list with versions for the course repo so I can't tell if this is caused by a recent version update or if it's something I'm doing wrong.

I cloned and installed the latest of all repos: gym, retro, retro-contest, and Deep_reinforcement_learning_Course

Is this an issue or am I being dense? Would greatly appreciate if anyone can shed some light on how to run the courses in this repo. I have not been successful so far.

kmcnayr commented 4 years ago

This was fixed in a recent update in the gym repo to the TimeLimit wrapper in commit 144c851

Either install the latest from github or update the time_limit.py file manually in your install.