Created
February 13, 2019 23:30
-
-
Save wut0n9/67f936aeb62ddbfc8ea2937a36269466 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
checkpoint_file = 'topic_dnn/tf/model-10' | |
session_conf = tf.ConfigProto( | |
allow_soft_placement=True, | |
log_device_placement=True | |
) | |
with tf.Session(config=session_conf) as sess: | |
saver = tf.train.import_meta_graph('{}.meta'.format(checkpoint_file)) | |
saver.restore(sess, checkpoint_file) | |
input_x = tf.get_default_graph().get_operation_by_name('input_x').outputs[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment