I am working with Keras to build my own CNN to identify cats and dogs. I've created a folder called "cats-and-dogs". This folder is in the same directory as is my jupyter notebook ("cats-and-dogs" folder & Keras.ipynb notebook both are in Anaconda3 folder). Now the further tree of folders looks like this:
cats-and-dogs/
|_______________train/
|_______________|_______cats/
|_______________________|_____1.jpg
|_______________________|_____2.jpg
|_______________________|_____...
|_______________|_______dogs/
|_______________________|_____21.jpg
|_______________________|_____22.jpg
|_______________________|_____...
|_______________test/
|_______________|_______cats/
|_______________________|_____41.jpg
|_______________________|_____42.jpg
|_______________________|_____...
|_______________|_______dogs/
|_______________________|_____61.jpg
|_______________________|_____62.jpg
|_______________________|_____...
|_______________Valid/
|_______________|_______cats/
|_______________________|_____81.jpg
|_______________________|_____82.jpg
|_______________________|_____...
|_______________|_______dogs/
|_______________________|_____101.jpg
|_______________________|_____102.jpg
|_______________________|_____...
Keras.ipynb
|____
|____
...
My code that gives out error is:
train_batches = ImageDataGenerator().flow_from_directory('cats-and-dogs/train', target_size=(224,224), classes=['dog','cat'], batch_size=10)
Expected output: Found 80 images belonging to 2 classes.
Actual output: Found 0 images belonging to 2 classes.
os.path.abspath('cats-and-dogs/train')
, I'm pretty sure it needs an absolute path. – TheLoneDeranger