model load weights code example
Example 1: load model keras
from tensorflow import keras
model = keras.models.load_model('path/to/location')
Example 2: export keras model at specific epoch
import keras
class CustomSaver(keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs={}):
if epoch == 2: # or save after some epoch, each k-th epoch etc.
self.model.save("model_{}.hd5".format(epoch))