Skip to content

Instantly share code, notes, and snippets.

@himanshurawlani
Created December 26, 2019 19:02
Show Gist options
  • Save himanshurawlani/ccb36828171d292888352bcfd5d745c0 to your computer and use it in GitHub Desktop.
Save himanshurawlani/ccb36828171d292888352bcfd5d745c0 to your computer and use it in GitHub Desktop.
def export(input_h5_file, export_path):
# The export path contains the name and the version of the model
tf.keras.backend.set_learning_phase(0) # Ignore dropout at inference
model = tf.keras.models.load_model(input_h5_file)
model.save(export_path, save_format='tf')
print(f"SavedModel created at {export_path}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment