How to visualize the graph in tensorboard using ckpt files?

Viewed 2513

I have ckpt files like these and that is all I have:

enter image description here

I wonder how to use these files to have a graph in tensorboard. If I have pb files, I don't need to run the graph, I just need to import the graph. All I have to do is using code:

import os
import tensorflow as tf

inception_graph_def_file = os.path.join('./', 'tensorflow_inception_graph.pb')
with tf.Session() as sess:
    with tf.gfile.FastGFile(inception_graph_def_file, 'rb') as f:
        graph_def = tf.GraphDef()
        graph_def.ParseFromString(f.read())
        tf.import_graph_def(graph_def, name='')
    writer = tf.summary.FileWriter('./', sess.graph)
    writer.close()

So, is there any ideas to using ckpt files like pb files?

1 Answers

No, i don't think so, otherwise they would have given in there repository. As of my knowledge .ckpt.meta file contain weight only, and only having weight we can't draw graph in tensorboard , its need some structure which is provided by graph_pb2.GraphDef() function.

I think you you should see this import_pb_tensorbord

You can run this by providing with essential parameter.

Related