I want to save my tensorflow session sess
but i have the following error
ValueError: Parent directory of trained_variables.ckpt doesn't exist, can't save.
This is my line of code :
saver.save(sess, "trained_variables.ckpt")
I've also tried to change the file name and put model
instead of trained_variables.ckpt
but i get the same problem.
Following this tutorial A TensorFlow Tutorial: Email Classification
saver.save(sess, "./trained_variables.ckpt")
I would guess that you're trying to save the file in a folder (directory) that doesn't exist...
Try using an absolute path for the file instead of just the bare filename.
You might want to check what your current working directory is... that could clear up things.
Does that help?
-josh
I've put the absoluth path of the file instead of the bare filename and it worked. This is the final code
saver.save(sess, os.path.join(os.getcwd(), 'trained_variables2.ckpt'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With