Assignment issue c2w1

FileNotFoundError Traceback (most recent call last)
in <cell line: 19>()
18 # Empty directories in case you run this cell multiple times
—> 19 if len(os.listdir(TRAINING_CATS_DIR)) > 0:
20 for file in os.scandir(TRAINING_CATS_DIR):
21 os.remove(file.path)

FileNotFoundError: [Errno 2] No such file or directory: ‘/tmp/cats-v-dogs/training/cats/’

I am getting this error in split part! i dont understand why!! when we already split the dataset the directories in train_val_dir then why we need here!!

You can easily find where the folder with the images is, just go to your top left side, there is a folder image, open it and check where this particular folder is!

Then you can copy its location and paste it into this code line!


you are getting error in split data because your code for * create_train_val_dirs where you need to define the path for your training and validation data is incorrect.

Kindly read the hint or instructions given in the assignment
< # Use os.makedirs to create your directories with intermediate subdirectories
<# Don’t hardcode the paths. Use os.path.join to append the new directories to the root_path parameter

You can read the below comment, in case you are not able to get the hint from the assignment