Skip to content

Instantly share code, notes, and snippets.

@lukmanr
Created October 17, 2018 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukmanr/03660888ba602b5d79f7adf8884833c1 to your computer and use it in GitHub Desktop.
Save lukmanr/03660888ba602b5d79f7adf8884833c1 to your computer and use it in GitHub Desktop.
TF Model Optimization 9
def get_graph_def_from_saved_model(saved_model_dir):
with tf.Session() as session:
meta_graph_def = tf.saved_model.loader.load(
session,
tags=[tag_constants.SERVING],
export_dir=saved_model_dir
)
return meta_graph_def.graph_def
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment