Skip to content

Instantly share code, notes, and snippets.

@gaphex
Created November 27, 2019 21:13
Show Gist options
  • Save gaphex/cf3e1e544cf06da1b766f7b7fc8ec392 to your computer and use it in GitHub Desktop.
Save gaphex/cf3e1e544cf06da1b766f7b7fc8ec392 to your computer and use it in GitHub Desktop.
def load_graph(frozen_graph_filename):
with tf.gfile.GFile(frozen_graph_filename, "rb") as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
with tf.Graph().as_default() as graph:
tf.import_graph_def(graph_def)
return graph
restored_graph = load_graph("frozen_graph.pb")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment