一、查看ckpt图结构
1、在ckpt文件所在文件夹中新建check_ckpt.py文件,代码如下
import tensorflow as tf
from tensorflow.summary import FileWriter
sess = tf.Session()
tf.train.import_meta_graph("./model.ckpt.meta")
FileWriter("__tb", sess.graph)
2、运行check_ckpt.py,生成__tb文件夹
3、在__tb文件夹中,按住shitf键,右键打开powershell
3、在powershell中输入:tensorboard --logdir=./ --host=127.0.0.15
4、在浏览器中输入powershell输出的地址,比如http::127.0.0.15:6006
一、查看pb模型的图结构
1、在pb模型文件所在文件夹中新建check_pb.py文件,代码如下
from tensorflow.python.platform import gfile
import tensorflow as tf
model = 'D:/test/model.pb'
graph = tf.get_default_graph()
graph_def = graph.as_graph_def()
graph_def.ParseFromString(gfile.FastGFile(model, 'rb').read())
tf.import_graph_def(graph_def, name='graph')
summaryWriter = tf.summary.FileWriter('D:/test/log/', graph)
2、运行check_pb.py,生成log文件夹
3、在log文件夹中,按住shitf键,右键打开powershell
3、在powershell中输入:tensorboard --logdir=./ --host=127.0.0.15
4、在浏览器中输入powershell输出的地址,比如http::127.0.0.15:6006