Problem in saving nnmodel.bin after training
bhooshan1996 opened this issue · 1 comments
After training "epoch 161, iteration 1450, accuracy 0.833333" I get an error which is for "nnmodel.bin"
Below is the output :
[2020-02-17 21:20:19,850 nnpcr.py:273 INFO] epoch 161, iteration 1450, accuracy 0.833333
[2020-02-17 21:26:10,731 nnpcr.py:284 INFO] Saver:
[2020-02-17 21:26:10,731 nnpcr.py:285 INFO] <tensorflow.python.training.saver.Saver object at 0x0000019169F28048>
2020-02-17 21:26:10.807918: W T:\src\github\tensorflow\tensorflow\core\framework\op_kernel.cc:1275] OP_REQUIRES failed at save_restore_v2_ops.cc:109 : Not found: Failed to create a directory: ; No such file or directory
Traceback (most recent call last):
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\client\session.py", line 1278, in _do_call
return fn(*args)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\client\session.py", line 1263, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\client\session.py", line 1350, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ; No such file or directory
[[Node: save/SaveV2 = SaveV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/SaveV2/tensor_names, save/SaveV2/shape_and_slices, W_conv1, W_conv1/Adagrad, W_conv2, W_conv2/Adagrad, W_conv3, W_conv3/Adagrad, W_conv4, W_conv4/Adagrad, W_fc1, W_fc1/Adagrad, W_fcO, W_fcO/Adagrad, b_conv1, b_conv1/Adagrad, b_conv2, b_conv2/Adagrad, b_conv3, b_conv3/Adagrad, b_conv4, b_conv4/Adagrad, b_fc1, b_fc1/Adagrad, b_fcO, b_fcO/Adagrad)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\training\saver.py", line 1620, in save
{self.saver_def.filename_tensor_name: checkpoint_file})
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\client\session.py", line 877, in run
run_metadata_ptr)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\client\session.py", line 1100, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\client\session.py", line 1272, in _do_run
run_metadata)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\client\session.py", line 1291, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ; No such file or directory
[[Node: save/SaveV2 = SaveV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/SaveV2/tensor_names, save/SaveV2/shape_and_slices, W_conv1, W_conv1/Adagrad, W_conv2, W_conv2/Adagrad, W_conv3, W_conv3/Adagrad, W_conv4, W_conv4/Adagrad, W_fc1, W_fc1/Adagrad, W_fcO, W_fcO/Adagrad, b_conv1, b_conv1/Adagrad, b_conv2, b_conv2/Adagrad, b_conv3, b_conv3/Adagrad, b_conv4, b_conv4/Adagrad, b_fc1, b_fc1/Adagrad, b_fcO, b_fcO/Adagrad)]]
Caused by op 'save/SaveV2', defined at:
File "nnpcr.py", line 316, in
pcr.saveModel('nnmodel.bin')
File "nnpcr.py", line 283, in saveModel
saver = tf.train.Saver()
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\training\saver.py", line 1281, in init
self.build()
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\training\saver.py", line 1293, in build
self._build(self._filename, build_save=True, build_restore=True)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\training\saver.py", line 1330, in _build
build_save=build_save, build_restore=build_restore)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\training\saver.py", line 775, in _build_internal
save_tensor = self._AddSaveOps(filename_tensor, saveables)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\training\saver.py", line 275, in _AddSaveOps
save = self.save_op(filename_tensor, saveables)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\training\saver.py", line 193, in save_op
tensors)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 1800, in save_v2
shape_and_slices=shape_and_slices, tensors=tensors, name=name)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\util\deprecation.py", line 454, in new_func
return func(*args, **kwargs)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\framework\ops.py", line 3155, in create_op
op_def=op_def)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\framework\ops.py", line 1717, in init
self._traceback = tf_stack.extract_stack()
NotFoundError (see above for traceback): Failed to create a directory: ; No such file or directory
[[Node: save/SaveV2 = SaveV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/SaveV2/tensor_names, save/SaveV2/shape_and_slices, W_conv1, W_conv1/Adagrad, W_conv2, W_conv2/Adagrad, W_conv3, W_conv3/Adagrad, W_conv4, W_conv4/Adagrad, W_fc1, W_fc1/Adagrad, W_fcO, W_fcO/Adagrad, b_conv1, b_conv1/Adagrad, b_conv2, b_conv2/Adagrad, b_conv3, b_conv3/Adagrad, b_conv4, b_conv4/Adagrad, b_fc1, b_fc1/Adagrad, b_fcO, b_fcO/Adagrad)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "nnpcr.py", line 316, in
pcr.saveModel('nnmodel.bin')
File "nnpcr.py", line 286, in saveModel
saver.save(self.__sess, fileName)
File "C:\Users\XXX\AppData\Local\Continuum\anaconda3\envs\nsfw\lib\site-packages\tensorflow\python\training\saver.py", line 1637, in save
raise exc
ValueError: Parent directory of nnmodel.bin doesn't exist, can't save.
same issue on my end, any suggestions?