English 中文(简体)
Saving Model
  • 时间:2024-12-22

Deep Learning with Keras - Saving Model


Previous Page Next Page  

We will save the trained model in our local drive in the models folder in our current working directory. To save the model, run the following code −


directory = "./models/"
name =  handwrittendigitrecognition.h5 
path = os.path.join(save_dir, name)
model.save(path)
print( Saved trained model at %s   % path)

The output after running the code is shown below −

Saving Model

Now, as you have saved a trained model, you may use it later on for processing your unknown data.

Advertisements