Reputation: 55
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.
Upvotes: 5
Views: 6289
Reputation: 327
Open tensorboard and use the "Upload" button on the left to upload the pbtxt file will directly open the graph in tensorboard.
Upvotes: 5
Reputation: 4543
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
Upvotes: 3