Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewing Graph from saved .pbtxt file on Tensorboard

I just have a graph.pbtxt file. I want to view the graph in tensorboard. But I am not aware of how to do that. Do I have to write any python script or can I do it from the terminal itself? Kindly help me to know the steps involved.

like image 371
Cherry Avatar asked Feb 28 '19 03:02

Cherry


People also ask

How do you visualize a graph in TensorBoard?

Select the Graphs dashboard by tapping “Graphs” at the top. You can also optionally use TensorBoard. dev to create a hosted, shareable experiment. By default, TensorBoard displays the op-level graph.

How do I visualize a Pbtxt file?

To visualize them: In the MediaPipe visualizer, click on the upload graph button and select the 2 pbtxt files to visualize (main graph and its associated subgraph). There will be 2 additional tabs.

What is Pbtxt?

config : path to the . pbtxt file that contains text graph definition in protobuf format. Resulting "Net" object is built by text graph using weights from a binary one that let us make it more flexible.


2 Answers

Open tensorboard and use the "Upload" button on the left to upload the pbtxt file will directly open the graph in tensorboard.

like image 132
zhuzilin Avatar answered Nov 08 '22 11:11

zhuzilin


You can save .pb file from your .pbtxt with tf.train.write_graph

from google.protobuf import text_format

with open('graph.pbtxt') as f:
    text_graph = f.read()
graph_def = text_format.Parse(text_graph, tf.GraphDef())
tf.train.write_graph(graph_def, path, 'graph.pb', as_text=False)

Then you can load it in tf.Session. Take a look at this gist
https://gist.github.com/jubjamie/2eec49ca1e4f58c5310d72918d991ef6

like image 39
Sharky Avatar answered Nov 08 '22 11:11

Sharky