Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't save the model #6

Open
Jordan-Volcano opened this issue Mar 4, 2017 · 5 comments
Open

Can't save the model #6

Jordan-Volcano opened this issue Mar 4, 2017 · 5 comments

Comments

@Jordan-Volcano
Copy link

Hello,

I'm trying your scripts, but i can predict any numbers because when i run create_model1 or create_model2. They finish because they can't save the model.
Here the error code :

Traceback (most recent call last):
File "create_model_1.py", line 61, in <module>
save_path = saver.save(sess, "model1.ckpt"')
File "C:\Users\Laura\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\training\saver.py", line 1365, in save
"Parent directory of {} doesn't exist, can't save.".format(save_path))
ValueError: Parent directory of model1.ckpt doesn't exist, can't save.

Thanks.
Jordan

@milapj
Copy link

milapj commented Mar 20, 2017

Hey, I am having the same issue, did you resolve it?

@Jordan-Volcano
Copy link
Author

No sry. I abandon this project.

cheers

@robotrickz
Copy link

robotrickz commented Apr 17, 2017

hey, first check whether the save_path is within the with tf.Session() as sess block, coz if its outside it then it would consider that the session is closed. Secondly, if the problem still persists then try adding import os.path and then add these lines to code
with tf.Session() as sess:
" same in the code"
save_path=saver.save(sess, os.path.join(os.getcwd(), 'model.ckpt'))
print ("Model saved in file: ", save_path)

This will give the absolute path of the the file.

If these don't work then , u could create a variable model_path='/tmp/model.ckpt'
then save_path=saver.save(sess, model_path)

@Link009
Copy link

Link009 commented Jul 5, 2017

You need to provide a full path to model.ckpt. Try with the full path where the file is (ex: your workspace).

@mgh3326
Copy link

mgh3326 commented Nov 6, 2018

Hello.
I had the same error.
Here's what you can do!
Have a great day!
save_path = saver.save(sess, "model.ckpt") to save_path = saver.save(sess, "./model.ckpt")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants