Created
May 25, 2018 21:42
-
-
Save jainanchit51/b8e819450e269806e542d7d2a945f76c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
train_generator = train_datagen.flow_from_directory( | |
train_data_dir, | |
target_size=(img_width, img_height), | |
batch_size=batch_size, | |
class_mode='binary') | |
print(train_generator.class_indices) | |
validation_generator = test_datagen.flow_from_directory( | |
validation_data_dir, | |
target_size=(img_width, img_height), | |
batch_size=batch_size, | |
class_mode='binary') | |
model.fit_generator( | |
train_generator, | |
steps_per_epoch=nb_train_samples // batch_size, | |
epochs=epochs, | |
validation_data=validation_generator, | |
validation_steps=nb_validation_samples // batch_size) | |
model.save('model.h5') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment