So the problem was that some of the images was corrupted.
After fetching the images i ran this command:
for each of the folders containing the images. I also had to clean up the filenames and remove spaces as well as removing images which wasn’t jpg format.
for f in *; do mv "$f" "$(sed 's/[^0-9A-Za-z.]/_/g' <<< "$f")"; done
find . -type f ! -name '*.jpg' -delete
I also change the size when creating the imageDataBunch from 26 to 224, but that is probably unrelated to my problem.
I finally got good result, not sure if my validationset of 50 is large enough. Training set was around 300-500 images. (Perhaps overfitting?)
I’m doing the first Lesson on the fast ai course.
I want to create my own image dataset which has images of squash games and tennis games. The classifier should be able to predict given an image of a tennis game or squash game, what it is.
Progress so far: I fetched around 400-500 images of squash and tennis games from google using the method in the first post of this thread.
The folder overview looks something like this:
/home/jupyter/.fastai/data/tennissquash/train/squash <— Has images of squash games.
/home/jupyter/.fastai/data/tennissquash/train/tennis<— Has images of tennis games.
I created a valid folder under /home/jupyter/.fastai/data/tennissquash/, same setup as training but with 50 photos for both tennis and squash each.
The problem I get is when I try to create a ImageDataBunch (see images)
What have I missed, how do I solve this problem correctly?