Reputation: 805
I have trained a keras model and saved it to later make predictions. However, I loaded the saved model using:
from keras.models import load_model
#Restore saved keras model
restored_keras_model = load_model("C:/*******/saved_model.hdf5")
Now I would like to save an image of the loaded model so I can visualize it before using it before making predictions.
Is there a way of doing this in keras or is the use of another library required?
Upvotes: 3
Views: 11612
Reputation: 6044
Yes, in addition to doing a restored_keras_model.summary(), you can save the model architecture as a png file using the plot_model API.
from keras.utils import plot_model
plot_model(restored_keras_model, to_file='model.png')
https://keras.io/visualization/#model-visualization
Upvotes: 10