I have a model.ckpt.meta
file and I just want to view the architecture/graph structure. I can't find how to do this from the model.ckpt.meta
file.
Following the code thanks to Milan:
tf.train.import_meta_graph("./model.ckpt.meta")
for n in tf.get_default_graph().as_graph_def().node:
print(n)
with tf.Session() as sess:
writer = tf.summary.FileWriter("./output/", sess.graph)
writer.close()
I get the graph below. But a lot of the architecture is missing.
EDIT: Woops! I forgot to double click the model. Sorted.
You can import the meta graph in python with tf.train.import_meta_graph
and then traverse the nodes in the graph, for example:
import tensorflow as tf
tf.train.import_meta_graph("./model.ckpt-200000.meta")
for n in tf.get_default_graph().as_graph_def().node:
print(n)
Once imported, you can make a summary file for Tensorboard, which allows you to visualize the graph nicely:
with tf.Session() as sess:
writer = tf.summary.FileWriter("./output/", sess.graph)
writer.close()
To see the saved summary file in Tensorboard, run tensorboard --logdir=./output/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With