I would like to save my entire model every couple of epochs, including state of the optimizer, custom metrics etc. during training with keras model.fit_generator(). The goal is to be able to resume training from the exact state where it was left off.
The code I am working with is in TF 1.14. I know about the ModelCheckpoint callback, but it saves models in hdf5 format by default, which apparently can't deal properly with custom loss. I thought that probably the callback is just calling model.save() in the predefined interval during training, so is there a way to change file format passed to this call to SavedModel in versions earlier than TF 2.x, yielding my desired result?