Your Generator Is Empty

Working on a project using fast.ai. I am using Google Colab, and have a folder of images. The goal is to determine whether an image is a rubber plant. The folder has 8 images, and I am trying to see how well the model will work with a small number of images. I am having trouble though because my code is saying my generator is empty. Any help would be great! I attached an image of my code and the error. My dataset consists of 4 positive rubber plant images and 4 not rubber plant images.

That’s a very small dataset. fastai will drop the last incomplete batch of data from the DataLoaders for the training dataset to help speed up time, and by default the batch size is 64, much more than 6 (taking to account the validation split)

The solution here would be to to use a much smaller batch size of perhaps 2 (pass it in as bs=2)

1 Like