docker中实验 tensorboard 显示pb图结构

实验在docker中进行, 所以 ip 为 0.0.0.0

import tensorflow as tf
from tensorflow.python.platform import gfile

graph = tf.get_default_graph()
graphdef = graph.as_graph_def()
graphdef.ParseFromString(gfile.FastGFile("your pb file path", "rb").read())
_ = tf.import_graph_def(graphdef, name="")

summary_write = tf.summary.FileWriter("./view_log" , graph)


启动命令:

tensorboard --logdir view_log --host 0.0.0.0 --port  50000

你可能感兴趣的:(tensorflow)