Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def save_weights(sess):
saver = tf.train.Saver()
saver.save(sess, './data/tf_io.ckpt')
def load_weights(sess, in_name, out_name):
tf.train.import_meta_graph('./data/tf_io.ckpt.meta')
saver = tf.train.Saver()
saver.restore(sess, './data/tf_io.ckpt')
X = tf.get_default_graph().get_tensor_by_name(in_name)
y = tf.get_default_graph().get_tensor_by_name(out_name)
return X, y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment