Skip to content

Instantly share code, notes, and snippets.

@himanshurawlani
Last active March 22, 2019 20:38
Show Gist options
  • Save himanshurawlani/426a00b2dedf4cbf77839c514a5068d4 to your computer and use it in GitHub Desktop.
Save himanshurawlani/426a00b2dedf4cbf77839c514a5068d4 to your computer and use it in GitHub Desktop.
Exporting Keras models to SavedModel format in TensorFlow 2.0
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