I am trying to restore a saved model . But it is returning me an error. Please help me out. code to save the model : save_model.py
import tensorflow as tf
v1 = tf.Variable(1.32, name="v1")
v2 = tf.Variable(1.33, name="v2")
init = tf.initialize_all_variables()
saver = tf.train.Saver()
with tf.Session() as sess:
sess.run(init)
save_path = saver.save(sess, "model.ckpt")
code to restore model : restore_model.py
import tensorflow as tf
v1 = tf.Variable(0, name="v1")
v2 = tf.Variable(0, name="v2")
saver = tf.train.Saver()
with tf.Session() as sess:
saver.restore(sess, "model.ckpt")
print("Model restored.")
I have saved both the files in the same directory.