Directory or Access error ([Errno 2] No such file or directory: '/tmp/PetImages/Cat/')

There was a problem compiling the code from your notebook. Details:
[Errno 2] No such file or directory: ‘/tmp/PetImages/Cat/’

I have successfully created the notebook and got a history.plt.
But after uploading the notebook to cousera for grading the above error occured several times.
The plt file was grade successfully.

I have no clue what i should do because the error does not occure within my colab runtime and the
files are downloaded and unzipped into the tmp folder correctly.
Also the preparation of the directory structure and the file copies work correctly.

Has anyone any idea.
Is there any error due to “google/drive” mounting?

I would appreciate help and say thanks in advance.
Christian Schack

Please don’t hard code paths. Use functions parameters and variables when possible.

I found it out. Sorry it was a stupid error.

I cleared accidently the whole tmp subdirectories at cell 5.

Define root directory

root_dir = ‘/tmp/’

Empty directory to prevent FileExistsError is the function is run several times

if os.path.exists(root_dir):

shutil.rmtree(root_dir)

Thank you for your hint. So i checked all pathes again.

Have a nice day!
Sincerely yours
Christian Schack