Gradient
Gradient copied to clipboard
Saving and Loading a model
Hi everyone, I had a quick question about how I can save and load a model. When I try using
model.save_weights("model.h5");
the model is not saved anywhere.
The model should be saved to the current directory, e.g. Environment.CurrentDirectory
Ah, I found it. Thanks. Now, when I'm trying to load the model, I'm doing:
var model = new Sequential();
model.load_weights("model.h5");
Is this the right way to do it?
@Cliff-Foreman you need to reproduce model structure first. E.g. pass all layers as you did for training.
If you want layers to be restored too, you need to refer to official TensorFlow documentation. https://www.tensorflow.org/tutorials/keras/save_and_load