We will load a saved model from a file, and then use it to make predictions on new data. We won’t need to know anything about the model to do this - we can do it all in a new file by loading a saved model.
Instructor: In a new Python file, import load model from keras.models. Then we can call the load model function, passing the file name of the model file that we saved. The result of that will be the entire trained model, so we can assign that to the model variable.
We can see the model details by calling model.summary. When we run that, we see all of the layers in the network and their sizes. This allows us to load and even inspect models that we didn't make ourselves. Then we can use this model to make predictions since it's a fully-trained model.
First, import NumPy, and then make a few input arrays to make predictions on. Then use the model's predict method to actually make those predictions. When we run that, we see the model's output predictions.
You must be a Pro Member to view code
Access all courses and lessons, track your progress, gain confidence and expertise.