从 Tensorboard 上保存的 .pbtxt 文件查看图表

Che*_*rry 4 python tensorflow tensorboard

我只有一个graph.pbtxt文件。我想在tensorboard 中查看图表。但我不知道如何做到这一点。我必须编写任何 python 脚本还是可以从终端本身完成?请帮助我了解所涉及的步骤。

zhu*_*lin 5

打开tensorboard并使用左侧的“上传”按钮上传pbtxt文件将直接在tensorboard中打开图形。


Sha*_*rky 3

您可以从您的保存.pb文件.pbtxttf.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)
Run Code Online (Sandbox Code Playgroud)

然后你就可以加载它了tf.Session。看看这个要点
https://gist.github.com/jubjamie/2eec49ca1e4f58c5310d72918d991ef6