0
私はモデルの保存と復元の方法を学びたいと思っています。私のモデルはので、ここで、少し過度に複雑であるストレートと同じエラーが発生し、コマンドラインのpythonから、MWE:このフォーマットは、ここでTensorFlowのマニュアルを参照して、以下のTensorflow保存と読み込み
import tensorflow as tf
v1 = tf.Variable(1, name="var1")
init_op = tf.initialize_all_variables()
saver = tf.train.Saver()
with tf.Session() as sess:
sess.run(init_op)
save_path = saver.save(sess, "testchk.ckpt")
print "model saved"
:https://www.tensorflow.org/versions/r0.11/api_docs/python/state_ops.html#Variable
エラー私は取得:
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/mnt/data/user/pkgs/enthought/canopy-1.5.1/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1080, in save
self.last_checkpoints, latest_filename)
File "/mnt/data/user/pkgs/enthought/canopy-1.5.1/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 632, in update_checkpoint_state
file_io.rename(temp_pathname, coord_checkpoint_filename, overwrite=True)
File "/mnt/data/user/pkgs/enthought/canopy-1.5.1/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 79, in rename
compat.as_bytes(oldname), compat.as_bytes(newname), overwrite, status)
File "/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/mnt/data/user/pkgs/enthought/canopy-1.5.1/lib/python2.7/site-packages/tensorflow/python/framework/errors.py", line 450, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors.FailedPreconditionError: checkpoint.tmp.fe418ea583db4995810d23d4ca308e3a
このエラーを解決するにはどうすればよいですか?
ファイルシステムエラーのように見えますが、パスは存在しますか?プログラムに書き込みアクセス権がありますか? – yuefengz
デフォルトでは現在の作業ディレクトリだけではありませんか?はい、書き込みアクセス権があります。 – StatsSorceress
絶対パスを使用してみますか? – yuefengz