openai / gym

A toolkit for developing and comparing reinforcement learning algorithms.
https://www.gymlibrary.dev
Other
34.65k stars 8.6k forks source link

FileNotFoundError #2017

Closed gopalm-ai closed 3 years ago

gopalm-ai commented 4 years ago

When running the OpenAI gym Atari Pong DQN code from Phil Tabor's Udemy course (https://github.com/philtabor/Deep-Q-Learning-Paper-To-Code), I am receiving the following FileNotFoundError.

File "main_dqn.py", line 57, in agent.save_models() File "/Users/gopal_mahadevan/Desktop/Python_Code/dqn_agent.py", line 71, in save_models self.q_eval.save_checkpoint() File "/Users/gopal_mahadevan/Desktop/Python_Code/deep_q_network.py", line 47, in save_checkpoint T.save(self.state_dict(), self.checkpoint_file) File "/opt/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 327, in save with _open_file_like(f, 'wb') as opened_file: File "/opt/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 212, in _open_file_like return _open_file(name_or_buffer, mode) File "/opt/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 193, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'models/BreakoutDeterministic-v4_DQNAgent_q_eval'

I suspect this may be a PyTorch issue, maybe I am missing a required dependency?

Any help would be greatly appreciated. This is hindering me from running this code in order to learn the basics of deep reinforcement learning.

jkterry1 commented 3 years ago

This is not a problem in the gym library itself