Skip to content

Commit 165b5cc

Browse files
authored
Add verbose logging when ModelCheckpoint callback is done saving ... (#21805)
* Add verbose logging when ModelCheckpoint callback is done saving a model. This is useful for collecting information on how long model checkpointing takes, together with existing verbose logging on initiating the save. * Update model_checkpoint.py Updated formatting for line length.
1 parent 3ad3845 commit 165b5cc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

keras/src/callbacks/model_checkpoint.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ def _save_model(self, epoch, batch, logs):
283283
self.model.save_weights(filepath, overwrite=True)
284284
else:
285285
self.model.save(filepath, overwrite=True)
286+
if self.verbose > 0:
287+
io_utils.print_msg(
288+
f"\nEpoch {epoch + 1}: "
289+
f"finished saving model to {filepath}"
290+
)
286291
except IsADirectoryError: # h5py 3.x
287292
raise IOError(
288293
"Please specify a non-directory filepath for "

0 commit comments

Comments
 (0)