Skip to content

Instantly share code, notes, and snippets.

@RameshKamath
Last active April 27, 2018 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RameshKamath/a6ccf67738177948f88798cfc16b4279 to your computer and use it in GitHub Desktop.
Save RameshKamath/a6ccf67738177948f88798cfc16b4279 to your computer and use it in GitHub Desktop.
To load saved .pb Graph in tensorboard with logs
import tensorflow as tf
with tf.Session() as sess:
model_filename ='insert .pb File here' #insert location of .pb file with mane of file
with tf.gfile.FastGFile(model_filename, 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
g_in = tf.import_graph_def(graph_def,name="Model")
# for Log dir of tensorboard
LOGDIR='./logs'
train_writer = tf.summary.FileWriter(LOGDIR)
train_writer.add_graph(sess.graph)
train_writer.flush()
train_writer.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment