简体   繁体   中英

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

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM