Created
August 21, 2019 15:44
-
-
Save dipanjanS/d35e60f86ebb1b03c31bdbfccd97bc63 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class EpochModelSaver(keras.callbacks.Callback): | |
| def on_epoch_end(self, epoch, logs={}): | |
| self.model.save('resnet50_finetune_full_seti_epoch_{}.h5'.format(epoch+1)) | |
| ms_epoch = EpochModelSaver() | |
| csv_logger = keras.callbacks.CSVLogger('resnet50_finetune_full_seti_log.csv', append=True, separator=',') | |
| history3 = model.fit_generator( | |
| train_generator, | |
| steps_per_epoch=math.ceil(5600 / TRAIN_BATCH_SIZE), | |
| epochs=500, | |
| validation_data=val_generator, | |
| validation_steps=math.ceil(700 / VAL_BATCH_SIZE), | |
| callbacks=[ms_epoch, csv_logger], verbose=1, | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment