问题
I'd like to load a keras model that i've trained and saved it as .pb.
Here's the code,
Am using a jupyter notebook.
The model is successfully saved as saved_model.pb under the same directory. But the code is unable to access it.
Can anybody see to it, how can i access this keras model that's saved in .pb extension.
I checked at several other places for solution but no luck.
Model is saved at model/saved_model.pb.
I've taken out the .pb file and placed it in the same directory where my code file exists.
回答1:
The function tf.keras.models.load_model
load a SavedModel
into a tf.keras
-model. The argument of the function is path to a saved model.
So try model = tf.keras.models.load_model('model')
来源:https://stackoverflow.com/questions/63146892/how-to-load-a-keras-model-saved-as-pb