Skip to content

Instantly share code, notes, and snippets.

@SmiffyKMc
Created June 16, 2022 18:15
Show Gist options
  • Save SmiffyKMc/44244325f7dad5447e46e91c8c16581c to your computer and use it in GitHub Desktop.
Save SmiffyKMc/44244325f7dad5447e46e91c8c16581c to your computer and use it in GitHub Desktop.
Fitting the model and allowing for saving of the model based on the best validation loss
callbacks = [
keras.callbacks.ModelCheckpoint(
filepath=f"{hotDogDir}hotdog_classifier_v1.keras",
monitor="val_loss",
save_best_only=True
)
]
history = model.fit(
train_dataset,
epochs=30,
validation_data=validation_dataset,
callbacks=callbacks
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment