Keras model history empty

When I call model.predict in callbacks, the model.history.history will be an empty dict.
I saw the same issue here

Not calling predict is not an option, as I have to use that in the callback to save model based on the validation metric (f1, auc, etc.)

Hi @Opfer_Abo

Welcome to the TensorFlow Forum!

Please refer to the solution given for the Stackoverflow issue you have mentioned. You need to define the history such as history = model.fit() to record metrics logs while training the model.

Please share minimal reproducible code to replicate and understand the error if the issue still persists. Thank you.

1 Like