Skip to content

Instantly share code, notes, and snippets.

@margaretmz
Last active July 13, 2020 04:31
Show Gist options
  • Save margaretmz/90dd10a9dd26f83b98ce25e644e6c63c to your computer and use it in GitHub Desktop.
Save margaretmz/90dd10a9dd26f83b98ce25e644e6c63c to your computer and use it in GitHub Desktop.
selfie2anime-load-checkpoint
def load_checkpoint(sess, ckpt_path):
model_saver = tf.train.Saver(tf.global_variables())
checkpoint = os.path.expanduser(checkpoint)
if tf.gfile.IsDirectory(checkpoint):
checkpoint = tf.train.latest_checkpoint(checkpoint)
tf.logging.info('loading latest checkpoint file: {}'.format(checkpoint))
model_saver.restore(sess, checkpoint)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment