'ValueError: The passed save_path is not a valid checkpoint: modeltest.ckpt

I run this code

tf.reset_default_graph()
v1 = tf.Variable(tf.constant(0.1, shape = [2]), name="v1")
v2 = tf.Variable(tf.constant(0.2, shape = [2]), name="v2")
saver = tf.train.Saver()
with tf.Session() as sess:
    saver.restore(sess, "/tmp/model/model.ckpt")

and then this error is occured:ValueError: The passed save_path is not a valid checkpoint: modeltest.ckpt

this is my env:

tensorflow (1.10.1)

tensorboard (1.10.0)

h5py (2.8.0)

Python 3.6.5

Could you please advice how to solve out this error

Thank you



Solution 1:[1]

If the model name is "modeltest.ckpt", then you probably have the model in a zip file (modeltest.zip). Then you need to extract the model into a folder (named "model\" for example) and it will include 3 files. Now you can use the name as follows: "model\modeltest.ckpt"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Euroka