While training my ML model, I applied CSVlogger and the ModelCheckpoint callbacks so basically all epochs metric results are logged by the CSVlogger and only best model saved.
However with save_best_only for ModelCheckpoint, how can we get/log the epoch number when the model is updated by ModelCheckpoint in the last time, just as an integer number.
csv_logger =CSVlogger('history.csv', append=True, seperator=";")
callbacks = [csv_logger,
tf.keras.callbacks.ModelCheckpoint('model.h5', verbose=1, save_best_only=True)
results = model.fit(X,Y, callbacks=callbacks, epochs=30)
# how can we have something like lastSavedEpoch = results.last_saved_epoch?
# e.g. it's lastly updated in 27th epoch although total training epochs is 30.