Last active
March 22, 2019 20:38
-
-
Save himanshurawlani/426a00b2dedf4cbf77839c514a5068d4 to your computer and use it in GitHub Desktop.
Exporting Keras models to SavedModel format in TensorFlow 2.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensorflow import keras | |
# '/1' specifies the version of a model, or "servable" we want to export | |
path_to_saved_model = 'SavedModel/inceptionv3_128_tf_flowers/1' | |
# Saving the keras model in SavedModel format | |
keras.experimental.export_saved_model(inception_model, path_to_saved_model) | |
# Load the saved keras model back | |
restored_saved_model = keras.experimental.load_from_saved_model(path_to_saved_model) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment