Discussions>Visualize pb model in Tensorboard>

Visualize pb model in Tensorboard

How to visualize a tensorflow model in tensorboard, when I've got only a pb model? I don't have the code to send it from the current session.

3 votesJO297.00
1 Answers
NN216.00
3

It's simple

LOG_DIR = 'logs'  # The path where you want to save tensorboard events

with tf.Session() as sess:
    model_filename = 'model.pb' # your model path
    with gfile.FastGFile(model_filename, 'rb') as f:
        graph_def = tf.GraphDef()
        graph_def.ParseFromString(f.read())
        g_in = tf.import_graph_def(graph_def)
train_writer = tf.summary.FileWriter(LOG_DIR)
train_writer.add_graph(sess.graph)
Reply
Couldn't find what you were looking for?and we will find an expert to answer.
How helpful was this page?