Skip to content

Instantly share code, notes, and snippets.

Avatar

Jamie Cooke jubjamie

View GitHub Profile
@jubjamie
jubjamie / pb_viewer.py
Created Mar 31, 2017
Load .pb into Tensorboard
View pb_viewer.py
import tensorflow as tf
from tensorflow.python.platform import gfile
with tf.Session() as sess:
model_filename ='PATH_TO_PB.pb'
with gfile.FastGFile(model_filename, 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
g_in = tf.import_graph_def(graph_def)
LOGDIR='/logs/tests/1/'
train_writer = tf.summary.FileWriter(LOGDIR)
You can’t perform that action at this time.