Created
February 8, 2017 07:11
-
-
Save benwu232/73d95d930c5e1f1555acc91de2a27bf8 to your computer and use it in GitHub Desktop.
Show how to restore model, parameters, inputs and outputs
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
import tensorflow as tf | |
tf.GraphKeys.USEFUL = 'useful' | |
saver = tf.train.import_meta_graph("./model_ex1.meta") | |
sess = tf.Session() | |
saver.restore(sess, "./model_ex1") | |
var_list = tf.get_collection(tf.GraphKeys.USEFUL) | |
v1 = var_list[0] | |
v2 = var_list[1] | |
v4 = var_list[2] | |
#result = sess.run(v4, feed_dict={"v1:0": 12.0, "v2:0": 3.3}) | |
result = sess.run(v4, feed_dict={v1:12.0, v2:3.3}) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment