ImageFolder not working

Hello, everybody!
I am having some serious trouble loading the images I want to load to serve as training for my neural network. It was actually working perfectly last night - I had classifications going and everything. I started on the network today, but when I tried to load the data again, it just… stopped working. I did not change anything that I am aware of, but now the ImageFolder does not think my path is valid. I believe that within the folder whose path I give to ImageFolder, I should have a bunch of inner folders - each of those folders has images of acceptable format, to be classified the same because they’re in the same inner folder. I have matched this structure. Within my ‘Images’ folder, I have 10 inner folders labelled 0-9. They each contain .jpeg images - and all the images in each folder belong to the same classification. So could I ask, what’s going on? Why did ImageFolder suddenly stop working on me? At the bottom of the error message (I am limited to one screen shot), it says, “FileNotFoundError: Found no valid file for the classes .ipynb_checkpoints. Supported extensions are: .jpg, .jpeg, .png, .ppm, .bmp, .pgm, .tif, .tiff, .webp”. Many thanks!

Hi Mikey!

FileNotFoundError means that perhaps there is a typo in your path variable. Did you mean to start it with something like C:/Users/caseyferguson/ rather than /Users/caseyferguson?

You can experiment by running something like:

import os
print(os.path.isdir(path))

or

os.listdir(path)

And seeing if you get expected results.

Good luck and let us know if you need further help!

Hi, Andrei!
Thank you so much for your response! So it does show all the folders as expected when I plug in os.listdir(path). The path seems to have been correct (which I copied from Terminal, so I guess it should be). But I was able to fix the problem! I think that my image folders just were not structured correctly for the ImageFolder to read them. I was able to copy these images into another location on my computer with images/folders that were structured correctly for ImageFolder to read them. I copied the relevant images in place of the images that were already there, and things are working fine now! Thanks again for your response.

Sincerely,

Mikey

Thank you so much for your response! So it does show all the folders as expected when I plug in os.listdir(path). The path seems to have been correct (which I copied from Terminal, so I guess it should be). But I was able to fix the problem! I think that my image folders just were not structured correctly for the ImageFolder to read them. I was able to copy these images into another location on my computer with images/folders that were structured correctly for ImageFolder to read them. I copied the relevant images in place of the images that were already there, and things are working fine now! Thanks again for your response.
Sincerely,
Mikey