Exercise 5.1: error + Question: where to find the learned policy file?

after training the cartpole for 2 episodes and saving the trained policy, when launching again, it gives me the following error:

(‘Loading from file:’, ‘qlearn_states.npy’)
Traceback (most recent call last):
File “/home/user/catkin_ws/src/my_cartpole_training/src/start_training.py”, line 60, in
File “/home/user/catkin_ws/src/my_cartpole_training/src/qlearn.py”, line 67, in load
self.q = np.load(filename).item()
File “/usr/local/lib/python2.7/dist-packages/numpy/lib/npyio.py”, line 447, in load
File “/usr/local/lib/python2.7/dist-packages/numpy/lib/format.py”, line 696, in read_array
raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False
[cartpole_gym-1] process has died [pid 13775, exit code 1, cmd /home/user/catkin_ws/src/my_cartpole_training/src/start_training.py __name:=cartpole_gym __log:=/home/user/.ros/log/40bff856-ef5c-11ea-b5ed-020c49a2de4d/cartpole_gym-1.log].

Also: where to find the learned policy file (qlearn_states.npy)? i did not find it anywhere in the files, if i want to move this learned experience file from one device to another


  1. The Poliy file will be saved where the main python script is. You can also change the path where its saved in:


  1. Check that your script is effectively finding it in the given path.