Skip to content

Instantly share code, notes, and snippets.

@mmatiaschek
Created September 18, 2017 19:31
Show Gist options
  • Save mmatiaschek/73f3a3741fc1676b7b51a887855c375a to your computer and use it in GitHub Desktop.
Save mmatiaschek/73f3a3741fc1676b7b51a887855c375a to your computer and use it in GitHub Desktop.
#create pb and pbtxt from data,index and meta
import tensorflow as tf
import tensorflow.contrib.slim as slim
print("imported Tensorflow")
tf.train.import_meta_graph('mpii-single-resnet-101.meta')
print("imported meta graph")
variables_to_restore = slim.get_variables_to_restore(include=["resnet_v1"])
restorer = tf.train.Saver(variables_to_restore)
saver = tf.train.Saver(max_to_keep=5)
tf.train.write_graph(sess.graph_def, './', 'graph.pbtxt')
tf.train.write_graph(sess.graph_def, './', 'graph.pb', as_text=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment