Hopefully I can save somebody a couple hours grief…
With a simple Sequential model defined in Keras, training was stopping early after upgrading from Keras 2.14 to 3.5 (this also happened recently on google colab).
I had multiple models but each one referenced a single global callback (EarlyStopping) object passed to fit(). In 2.14 Keras, this worked fine but in 3.5, only the first model trained correctly. It appears that the state of the EarlyStopping object is no longer reset with each use and a separate instance of EarlyStopping should be used for each model.
I was able to reproduce the issue by setting up two simple Sequential models with a single instance of EarlyStopping passed as a callback in the fit function.
In Keras 2.14, both models train correctly. After upgrading Keras to the latest version (3.5), the second model stopped early after the patience value.
Using two separate instances of EarlyStopping passed to the two fit functions solved the issue.
Hugh Osborne is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.