Skip to content

Instantly share code, notes, and snippets.

@iamsurya
Created June 6, 2019 19:04
Show Gist options
  • Save iamsurya/3f580aa72fbddb1f54a744e4430fbd6f to your computer and use it in GitHub Desktop.
Save iamsurya/3f580aa72fbddb1f54a744e4430fbd6f to your computer and use it in GitHub Desktop.
from tensorflow.python.platform import gfile
with tf.Session() as sess:
with gfile.FastGFile('slopemodel/slopemodel.pb', 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
sess.graph.as_default()
g_in = tf.import_graph_def(graph_def)
for op in tf.get_default_graph().get_operations():
print(str(op.name))
for n in tf.get_default_graph().as_graph_def().node:
print(n.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment