Hi, I have an issue in ImageDataGenerator. For test, ImageDataGenerator understand classes number but it can’t found images.
Expected Output:
Found 2000 images belonging to 2 classes.
Found 1000 images belonging to 2 classes.
Found 50 images belonging to 1 classes.
My Code:
train_image_generator = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255)
validation_image_generator = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255)
test_image_generator = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255)
train_data_gen = train_image_generator.flow_from_directory(train_dir,
target_size=(IMG_HEIGHT, IMG_WIDTH),
batch_size=batch_size,
class_mode='binary',
color_mode='rgb')
val_data_gen = validation_image_generator.flow_from_directory(validation_dir,
target_size=(IMG_HEIGHT, IMG_WIDTH),
batch_size=batch_size,
class_mode='binary',
color_mode='rgb')
test_data_gen = test_image_generator.flow_from_directory(directory=test_dir,
target_size=(IMG_HEIGHT, IMG_WIDTH),
batch_size=batch_size,
class_mode='binary',
color_mode='rgb',
classes=['test'],
shuffle=False)
My Output:
Found 2000 images belonging to 2 classes.
Found 1000 images belonging to 2 classes.
Found 0 images belonging to 1 classes.
If you want to see notebook:
cats_dog_classifier
Thanks for your helps