Do Keras epoch-counting callbacks work across several fitting sessions?



Some Keras callbacks, like ModelCheckpoint or ReduceLROnPlateau, rely on counting the number of epochs that some condition is met until some action is taken.

For certain purposes I need to train a Keras model in several fitting sessions, so something like

for epoch in range(num_epochs):, epochs=1)

rather than, epochs=num_epochs)

I was wondering if Keras callbacks work even if I use them across several fitting sessions.


Each time is called callbacks.History is reset. So no, it will not work like that. While you could log yourself as @kacpo1 mentioned and save each, you may benefit from the train_on_batch(...) method. This performs a single update and you can set reset_metrics=False in the method call to retain your metrics.

Answered By – Aidan Costello

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More