方法1
读取pb文件, 然后将graph保存到log文件中,然后使用tensorboard就能打开
import tensorflow as tf
from tensorflow.python.platform import gfile
path = './'
model = 'tnn.pb'
graph = tf.get_default_graph()
graph_def = graph.as_graph_def()
graph_def.ParseFromString(gfile.FastGFile(path + model, 'rb').read())
tf.import_graph_def(graph_def, name='graph')
summaryWriter = tf.compat.v1.summary.FileWriter(path + 'log/', graph)
方法2
使用网页 https://netron.app 打开.pb文件