I've built and trained an RNN model in Colaboratory, and saved it using the checkpoint callback:
tf.keras.callbacks.ModelCheckpoint( filepath=chkpt_p, save_weights_only=False)
And the saved data looks like this:
If I understand correctly, this directory includes both the model and the weights. Which function should I use to restore it (in another runtime)?
This worked for me:
model = tf.keras.models.load_model(save_dir,compile=False)
I had one issue with using tf.saved_model.load
, which doesn't produce a keras object, and one TF not finding the loss function with compile=True
.