Hello. I checked all the topics here but mine is little different. I’m getting this error and says “No such file or directory: ‘/tmp/cats-v-dogs/training/cats/4431.jpg’”. My questions are:
Source locations are correctly provided while calling the function as well as while defining the function which is “tmp/PetImages/Cat/”. But why does this checks “cats-v-dogs/training/cats” directory to copy the files? “cats-v-dogs/training/cats” is Destination directory.
When creating training and validation directory structure in create_train_val_dirs, please pay attention to case (see Cats instead of cats and Dogs instead of dogs:
I changed my code based on your message, but I’m still getting the same error, No such file or directory: ‘/tmp/cats-v-dogs/training/cats/’ in the test your split data function block
Based on my experience, I think it has to do with only creation of the folders. Check each and everything clearly even the small details like “case sensitive letters”, “spaces”. Or try to check source and destinated folder have been correctly set, while copying the files.
The folders names(case sensitive) and everything should be exactly like the “Expected Output”.
YOOOOOOO!!! Thank you so much!! I finally got passed that error, I’ve been working on this project for two weeks! I was confused on what the output was supposed to be, was it suppose to look like the “expected output”, or the “actual output” in Balaji Ambresh’s message. Now I got it. For anyone having the issue where you program gives you the error saying “No such file or directory: ‘/tmp/cats-v-dogs/training/cats/" The output in the code block where it says “# Test your create_train_val_dirs function” which is right under the code block where you create your directories for training and validation, it’s supposed to print a message that shows the “expected output” If you need help creating the train and validation directories, check the link here and it will show you an example of what the code should look like. You will have to experiment to get the code right on the assignment, but once you set up everything correctly you will no longer get that error. Thank you so much for helping me Dilipraj Dasari and Balaji Ambresh!
Same, i have a problem. My code is error and i changed my code based on your massage but, still the same error.
FileNotFoundError Traceback (most recent call last)
in <cell line: 19>()
17
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/’