Skip to content

Instantly share code, notes, and snippets.

@iwatake2222
Created May 3, 2019 13:48
Show Gist options
  • Save iwatake2222/841084e4aa09bd5d205ea14669a83059 to your computer and use it in GitHub Desktop.
Save iwatake2222/841084e4aa09bd5d205ea14669a83059 to your computer and use it in GitHub Desktop.
TensorFlowモデル(pb)の構造を見る
import tensorflow as tf
with tf.Session() as sess:
with tf.gfile.GFile('conv_mnist.pb', 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
g_in = tf.import_graph_def(graph_def)
train_writer = tf.summary.FileWriter('logs')
train_writer.add_graph(sess.graph)
'''
python create_graph_for_tensorboard.py
tensorboard --logdir=logs
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment