从 Tensorboard 上保存的 .pbtxt 文件查看图表
Viewing Graph from saved .pbtxt file on Tensorboard
我只有一个 graph.pbtxt 文件。我想在 tensorboard 中查看图表。但我不知道该怎么做。我必须编写任何 python 脚本还是可以从终端本身完成?请帮助我了解所涉及的步骤。
您可以使用 tf.train.write_graph
从 .pbtxt
保存 .pb
文件
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)
然后就可以在tf.Session
中载入了。看看这个要点
https://gist.github.com/jubjamie/2eec49ca1e4f58c5310d72918d991ef6
打开tensorboard,使用左侧的"Upload"按钮上传pbtxt文件,将直接在tensorboard中打开graph。
我只有一个 graph.pbtxt 文件。我想在 tensorboard 中查看图表。但我不知道该怎么做。我必须编写任何 python 脚本还是可以从终端本身完成?请帮助我了解所涉及的步骤。
您可以使用 tf.train.write_graph
.pbtxt
保存 .pb
文件
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)
然后就可以在tf.Session
中载入了。看看这个要点
https://gist.github.com/jubjamie/2eec49ca1e4f58c5310d72918d991ef6
打开tensorboard,使用左侧的"Upload"按钮上传pbtxt文件,将直接在tensorboard中打开graph。