PacktPublishing / Deep-Reinforcement-Learning-Hands-On

Hands-on Deep Reinforcement Learning, published by Packt
MIT License
2.81k stars 1.28k forks source link

Chapter 06 03_dqn_play.py #87

Closed BobD1960 closed 3 years ago

BobD1960 commented 3 years ago

After running the 02_dqn_pong.py, it concludes, and generates many files. When trying to play one using dqn_play.py, I am getting an error:


$ python3.7 03_dqnplay.py -m 'PongNoFrameskip-v4-best-19/archive/data.pkl' -r 'monitor'

Traceback (most recent call last): File "03_dqn_play.py", line 36, in state = torch.load(args.model, maplocation=lambda stg, : stg) File "/home/bob/.local/lib/python3.7/site-packages/torch/serialization.py", line 595, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "/home/bob/.local/lib/python3.7/site-packages/torch/serialization.py", line 764, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) _pickle.UnpicklingError: A load persistent id instruction was encountered, but no persistent_load function was specified.


I have tried this with different Python versions but I get the same error?

What is the correct command-line to run the dqn_play.py please?

BobD1960 commented 3 years ago

Solved. I was running it on the wrong file. Solved! (Dumb User Error.....as is often the case)

SamMohel commented 3 years ago

exucse me how can you run the wrong file? does the path was wrong ?