philtabor / Youtube-Code-Repository

Repository for most of the code from my YouTube channel
873 stars 479 forks source link

OSError: Unable to create file (unable to open file: name = 'home/ak/Desktop/DDPG/DDPG/tensorflow2/Mir robot/tmp/ddpg/actor_ddpg.h5', errno = 2, error message = 'No such file or directory', flags = 13, o_flags = 242) #34

Closed akniloy6 closed 3 years ago

akniloy6 commented 3 years ago

I am getting this error while training. Any idea on how to solve this? ... saving models ... Traceback (most recent call last): File "/home/ak/Desktop/DDPG/DDPG/tensorflow2/Mir robot/main_ddpg.py", line 63, in agent.save_models() File "/home/ak/Desktop/DDPG/DDPG/tensorflow2/Mir robot/ddpg_tf2.py", line 56, in save_models self.actor.save_weights(self.actor.checkpoint_file) File "/home/ak/.local/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py", line 2217, in save_weights with h5py.File(filepath, 'w') as f: File "/home/ak/.local/lib/python3.8/site-packages/h5py/_hl/files.py", line 424, in init fid = make_fid(name, mode, userblock_size, File "/home/ak/.local/lib/python3.8/site-packages/h5py/_hl/files.py", line 196, in make_fid fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5f.pyx", line 116, in h5py.h5f.create OSError: Unable to create file (unable to open file: name = 'home/ak/Desktop/DDPG/DDPG/tensorflow2/Mir robot/tmp/ddpg/actor_ddpg.h5', errno = 2, error message = 'No such file or directory', flags = 13, o_flags = 242)

akniloy6 commented 3 years ago

using mkdir to create the path rather than a direct new folder solved the problem for me. Closing ...