1

我已经训练了一个模型(这里有一个链接!)我通过以下方式成功训练了模型:

python train.py --model DeepLabV3_plus

当我想运行 test.py 时,我得到了标题中提到的错误。检查点文件夹包含测试所需的所有权重,我尝试将检查点分配给模型:

python test.py --model DeepLabV3_plus --checkpoint_path checkpoints

但未能运行它。你能帮我运行test.py吗?

PS:我最终需要在新数据集上预测模型,对此部分的任何帮助也表示赞赏。

我已阅读https://github.com/davidsandberg/facenet/issues/251https://github.com/balancap/SSD-Tensorflow/issues/150但他们帮不了我。

Loading model checkpoint weights ...
2019-09-08 20:05:13.667832: W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open .\checkpoints: Unknown: NewRandomAccessFile failed to Create/Open: .\checkpoints : Access is denied.
; Input/output error
2019-09-08 20:05:13.873491: W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open .\checkpoints: Unknown: NewRandomAccessFile failed to Create/Open: .\checkpoints : Access is denied.
; Input/output error
2019-09-08 20:05:13.878487: W tensorflow/core/framework/op_kernel.cc:1273] OP_REQUIRES failed at save_restore_tensor.cc:175 : Data loss: Unable to open table file .\checkpoints: Unknown: NewRandomAccessFile failed to Create/Open: .\checkpoints : Access is denied.
; Input/output error
Traceback (most recent call last):
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\client\session.py", line 1334, in _do_call
    return fn(*args)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\client\session.py", line 1319, in _run_fn
    options, feed_dict, fetch_list, target_list, run_metadata)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\client\session.py", line 1407, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file .\checkpoints: Unknown: NewRandomAccessFile failed to Create/Open: .\checkpoints : Access is denied.
; Input/output error
         [[{{node save_1/RestoreV2}} = RestoreV2[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_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]]
         [[{{node save_1/RestoreV2/_307}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_312_save_1/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 43, in <module>
    saver.restore(sess, args.checkpoint_path)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\saver.py", line 1546, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\client\session.py", line 929, in run
    run_metadata_ptr)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\client\session.py", line 1152, in _run
    feed_dict_tensor, options, run_metadata)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\client\session.py", line 1328, in _do_run
    run_metadata)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\client\session.py", line 1348, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file .\checkpoints: Unknown: NewRandomAccessFile failed to Create/Open: .\checkpoints : Access is denied.
; Input/output error
         [[node save_1/RestoreV2 (defined at test.py:42)  = RestoreV2[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_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]]
         [[{{node save_1/RestoreV2/_307}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_312_save_1/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

Caused by op 'save_1/RestoreV2', defined at:
  File "test.py", line 42, in <module>
    saver=tf.train.Saver(max_to_keep=1000)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\saver.py", line 1102, in __init__
    self.build()
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\saver.py", line 1114, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\saver.py", line 1151, in _build
    build_save=build_save, build_restore=build_restore)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\saver.py", line 795, in _build_internal
    restore_sequentially, reshape)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\saver.py", line 406, in _AddRestoreOps
    restore_sequentially)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\training\saver.py", line 862, in bulk_restore
    return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 1466, in restore_v2
    shape_and_slices=shape_and_slices, dtypes=dtypes, name=name)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\util\deprecation.py", line 488, in new_func
    return func(*args, **kwargs)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\framework\ops.py", line 3274, in create_op
    op_def=op_def)
  File "C:\Users\xxxxx\Anaconda3\envs\py36\lib\site-packages\tensorflow\python\framework\ops.py", line 1770, in __init__
    self._traceback = tf_stack.extract_stack()

DataLossError (see above for traceback): Unable to open table file .\checkpoints: Unknown: NewRandomAccessFile failed to Create/Open: .\checkpoints : Access is denied.
; Input/output error
         [[node save_1/RestoreV2 (defined at test.py:42)  = RestoreV2[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_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]]
         [[{{node save_1/RestoreV2/_307}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_312_save_1/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
4

0 回答 0