Home > database >  Do I need to compile the model again after loading the model from a ".h5" file in keras?
Do I need to compile the model again after loading the model from a ".h5" file in keras?

Time:07-02

can I continue training the model after loading the model like this

model = keras.models.load_model('path to .h5 file')

or do i have to use model.compile() again?

CodePudding user response:

yes.

Save your model as .h5

When you want to train your model, load it again and do a model.fit as normal.

Make sure you do not compile your model after loading it as this will reset your weights.

See this link for more info

  • Related