Created
June 23, 2019 18:42
-
-
Save williamjshipman/16d11fbaf14e4eb905ad83289102bad0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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