Created
June 23, 2017 20:50
-
-
Save subhankar94/0efa0a99d1223768531a65f2e5b1c673 to your computer and use it in GitHub Desktop.
restoring from checkpoint for TensorFlow v1.x
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
# usage: python restore_checkpoint.py model.ckpt-1000 | |
import sys | |
import tensorflow as tf | |
ckpt = sys.argv[1] | |
# soft placement in case using a different system setup | |
config = tf.ConfigProto(allow_soft_placement=True) | |
with tf.Session(config=config) as sess: | |
new_saver = tf.train.import_meta_graph(ckpt + '.meta') | |
new_saver.restore(sess, ckpt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment