Answer the question
In order to leave comments, you need to log in
What is the validation principle in ImageDataGenerator?
I made a generator from the directory (flow_from_directory) with the selection of validation data (validation_split=0.25). Based on it, there are two fillings: test (train_generator1) and verification (validation_generator1).
datagen1 = ImageDataGenerator(rescale=1./255, rotation_range=60, width_shift_range=0.2, height_shift_range=0.2, zoom_range=0.5, horizontal_flip=True, vertical_flip=True, validation_split=0.25)
train_generator1 = datagen1.flow_from_directory(directory=dir1, target_size=(150,150), batch_size=39, class_mode='sparse', save_to_dir=dir2_1, save_prefix=u'XXX', subset='training')
validation_generator1 = datagen1.flow_from_directory(directory=dir1, target_size=(150,150), batch_size=39, class_mode='sparse', save_to_dir=dir2_2, save_prefix=u'XXX', subset='validation')
history = model.fit_generator(train_gen, steps_per_epoch=156, validation_data=val_gen, validation_steps=52)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question