Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. # usage: python restore_checkpoint.py model.ckpt-1000
  2. import sys
  3. import tensorflow as tf
  4.  
  5. ckpt = sys.argv[1]
  6. # soft placement in case using a different system setup
  7. config = tf.ConfigProto(allow_soft_placement=True)
  8. with tf.Session(config=config) as sess:
  9. new_saver = tf.train.import_meta_graph(ckpt + '.meta')
  10. new_saver.restore(sess, ckpt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement