Deep Learning with Keras Tutorial, Callbacks
ModelCheckpoint Example
from keras.callbacks import ModelCheckpoint
model_checkpoint = ModelCheckpoint(
filepath="checkpoints/best_model.weights.h5",
monitor="val_loss",
save_best_only=True,
save_weights_only=True,
verbose=1,
)
history = model.fit(
...,
callbacks=[tensorboard_callback, early_stopping, model_checkpoint],
)