Path issue with vgg.get_batches function

I’m getting a weird path issue when running redux.ipynb:

When I run the following command:
batches = vgg.get_batches(path+‘train’, batch_size=batch_size)

I am getting a message that says:
“Found 0 images belonging to 0 classes”

I took the following steps to debug the issue:

  1. I double checked to make sure I have files under ‘/home/ubuntu/nbs/data/redux/train’. I see 23001 files in there. The PATH is set as follows: path = “/home/ubuntu/nbs/data/redux/”

  2. I also tried calling the above function with absolute path

  3. I also checked to make sure that the vgg object is created properly and loaded (I can see the function definition with ??vgg).

  4. I double checked the batch_size variable and it’s set to 64

Still not working (“Found 0 images belonging to 0 classes”). Any tips on how to resolve this issue?

You need one subdirectory per class to use the batches functionality in keras. That’s how it knows the labels for your images. So you’d need two subdirectories - ‘dogs’ and ‘cats’.

1 Like

I missed that par. It’s working now. Thanks Jeremy