I am using flow_from_directory()
and fit_generator
in my deep learning model, and I want to use cross validation method to train the CNN model.
datagen = ImageDataGenerator(rotation_range=15,width_shift_range=0.2,
height_shift_range=0.2,shear_range=0.2,
zoom_range=0.2,horizontal_flip=True,
fill_mode='nearest')
image_size = (224, 224)
batch = 32
train_generator = datagen.flow_from_directory(train_data,
target_size=image_size,
batch_size=batch,
classes= classes_array)
I found this Youtube video and this Tutorial, But it is not use flow_from_directory()
.
Do you have any idea how do I use k-fold cross validation when using fit_generator
and flow_from_directory()
in Keras?