Tensorflow 通过google对象检测API重新训练时发生超出范围错误

Tensorflow 通过google对象检测API重新训练时发生超出范围错误,tensorflow,machine-learning,deep-learning,Tensorflow,Machine Learning,Deep Learning,我正在尝试使用谷歌对象检测API对预先训练好的网络进行再培训 但我遇到了以下错误:主要错误返回到 self._traceback = self._graph._extract_stack() # pylint: disable=protected-access 我想不出这个错误与什么有关。我正在使用Ubuntu18,Python3.6。我将感谢你的帮助和评论。 我在这里附上了完整的日志: INFO:tensorflow:Caught OutOfRangeError. Stopping Tr

我正在尝试使用谷歌对象检测API对预先训练好的网络进行再培训

但我遇到了以下错误:主要错误返回到

self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access
我想不出这个错误与什么有关。我正在使用Ubuntu18,Python3.6。我将感谢你的帮助和评论。 我在这里附上了完整的日志:

 INFO:tensorflow:Caught OutOfRangeError. Stopping Training. FIFOQueue '_6_prefetch_queue' is closed and has insufficient elements (requested 1, current size 0)
     [[Node: prefetch_queue_Dequeue = QueueDequeueV2[component_types=[DT_STRING, DT_INT32, DT_FLOAT, DT_INT32, DT_FLOAT, ..., DT_INT32, DT_INT32, DT_INT32, DT_STRING, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](prefetch_queue)]]

Caused by op 'prefetch_queue_Dequeue', defined at:
  File "/home/tree/MEGAsync/PyProj_right/TransferFineTuneLAB/tensorflow_toy_detector/train.py", line 206, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "/home/tree/MEGAsync/PyProj_right/TransferFineTuneLAB/tensorflow_toy_detector/train.py", line 202, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/tree/models/research/object_detection/trainer.py", line 285, in train
    clones = model_deploy.create_clones(deploy_config, model_fn, [input_queue])
  File "/home/tree/models/research/slim/deployment/model_deploy.py", line 193, in create_clones
    outputs = model_fn(*args, **kwargs)
  File "/home/tree/models/research/object_detection/trainer.py", line 177, in _create_losses
    train_config.use_multiclass_scores)
  File "/home/tree/models/research/object_detection/trainer.py", line 122, in get_inputs
    read_data_list = input_queue.dequeue()
  File "/home/tree/models/research/object_detection/core/batcher.py", line 111, in dequeue
    batched_tensors = self._queue.dequeue()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/data_flow_ops.py", line 440, in dequeue
    self._queue_ref, self._dtypes, name=name)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/gen_data_flow_ops.py", line 3734, in queue_dequeue_v2
    timeout_ms=timeout_ms, name=name)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
    op_def=op_def)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 1718, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

OutOfRangeError (see above for traceback): FIFOQueue '_6_prefetch_queue' is closed and has insufficient elements (requested 1, current size 0)
     [[Node: prefetch_queue_Dequeue = QueueDequeueV2[component_types=[DT_STRING, DT_INT32, DT_FLOAT, DT_INT32, DT_FLOAT, ..., DT_INT32, DT_INT32, DT_INT32, DT_STRING, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](prefetch_queue)]]

INFO:tensorflow:Finished training! Saving model to disk.
Traceback (most recent call last):
  File "/home/tree/MEGAsync/PyProj_right/TransferFineTuneLAB/tensorflow_toy_detector/train.py", line 206, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "/home/tree/MEGAsync/PyProj_right/TransferFineTuneLAB/tensorflow_toy_detector/train.py", line 202, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/tree/models/research/object_detection/trainer.py", line 410, in train
    saver=saver)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/slim/python/slim/learning.py", line 784, in train
    ignore_live_threads=ignore_live_threads)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/supervisor.py", line 828, in stop
    ignore_live_threads=ignore_live_threads)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/coordinator.py", line 389, in join
    six.reraise(*self._exc_info_to_raise)
  File "/home/tree/.local/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 252, in _run
    enqueue_callable()
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1244, in _single_operation_run
    self._call_tf_sessionrun(None, {}, [], target_list, None)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.NotFoundError: /home/tree/MEGAsync/PyProj_right/TransferFineTuneLAB/tensorflow_toy_detector/tfdata.tfrecord; No such file or directory
     [[Node: parallel_read/ReaderReadV2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/device:CPU:0"](parallel_read/TFRecordReaderV2, parallel_read/filenames)]]
信息:tensorflow:捕获范围错误。停止训练。FIFOQUUE“\u 6\u预取\u队列”已关闭,元素不足(请求的1个,当前大小为0)
[[Node:prefetch_queue_Dequeue=QueueDequeueV2[组件类型=[DT_STRING,DT_INT32,DT_FLOAT,DT_INT32,DT_FLOAT,…,DT_INT32,DT_INT32,DT_STRING,DT_INT32],timeout_ms=-1,_device=“/job:localhost/replica:0/任务:0/device:CPU:0”](预取队列)]]
由op“预回迁队列”引起,定义于:
文件“/home/tree/MEGAsync/PyProj_right/TransferFineTuneLAB/tensorflow_toy_detector/train.py”,第206行,在
tf.app.run()
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py”,第126行,正在运行
_系统出口(主(argv))
文件“/home/tree/MEGAsync/PyProj_right/TransferFineTuneLAB/tensorflow_toy_detector/train.py”,第202行,主视图
工人\工作\姓名,是\旗舰队队长。列车长)
文件“/home/tree/models/research/object_detection/trainer.py”,第285行,列车中
克隆=模型部署。创建克隆(部署配置,模型部署fn,[输入队列])
文件“/home/tree/models/research/slim/deployment/model_deploy.py”,第193行,在创建克隆中
输出=型号fn(*args,**kwargs)
文件“/home/tree/models/research/object\u detection/trainer.py”,第177行,在“创建损失”中
列车配置使用多类分数)
文件“/home/tree/models/research/object\u detection/trainer.py”,第122行,在get\u输入中
read_data_list=input_queue.dequeue()
文件“/home/tree/models/research/object_detection/core/batcher.py”,第111行,出列
批处理张量=self.\u queue.dequeue()
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/data\u-flow\u-ops.py”,第440行,出列
self.\u queue\u ref,self.\u数据类型,name=name)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/gen_-data_-flow_-ops.py”,第3734行,在queue\u-dequeue\u v2中
超时时间=超时时间,名称=名称)
文件“/usr/local/lib/python3.6/dist packages/tensorflow/python/framework/op_def_library.py”,第787行,在“应用”和“操作”帮助程序中
op_def=op_def)
文件“/usr/local/lib/python3.6/dist packages/tensorflow/python/framework/ops.py”,第3392行,在create_op中
op_def=op_def)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py”,第1718行,在__
self._traceback=self._graph._extract_stack()35; pylint:disable=protected access
OutOfRangeError(回溯请参见上文):FIFOQUUE“\u 6\u预回迁\u队列”已关闭且元素不足(请求的1,当前大小为0)
[[Node:prefetch_queue_Dequeue=QueueDequeueV2[组件类型=[DT_STRING,DT_INT32,DT_FLOAT,DT_INT32,DT_FLOAT,…,DT_INT32,DT_INT32,DT_STRING,DT_INT32],timeout_ms=-1,_device=“/job:localhost/replica:0/任务:0/device:CPU:0”](预取队列)]]
信息:tensorflow:完成培训!将模型保存到磁盘。
回溯(最近一次呼叫最后一次):
文件“/home/tree/MEGAsync/PyProj_right/TransferFineTuneLAB/tensorflow_toy_detector/train.py”,第206行,在
tf.app.run()
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py”,第126行,正在运行
_系统出口(主(argv))
文件“/home/tree/MEGAsync/PyProj_right/TransferFineTuneLAB/tensorflow_toy_detector/train.py”,第202行,主视图
工人\工作\姓名,是\旗舰队队长。列车长)
文件“/home/tree/models/research/object_detection/trainer.py”,第410行,列车中
储蓄者=储蓄者)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/contrib/slim/python/slim/learning.py”,第784行,列车中
忽略\u活动\u线程=忽略\u活动\u线程)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/supervisor.py”,第828行,在stop中
忽略\u活动\u线程=忽略\u活动\u线程)
文件“/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/coordinator.py”,第389行,在join中
六、重新提升(*自我执行信息提升)
文件“/home/tree/.local/lib/python3.6/site packages/six.py”,第693行,在reraise中
增值
文件“/usr/local/lib/python3.6/dist packages/tensorflow/python/training/queue\u runner\u impl.py”,第252行,in\u run
排队_callable()
文件“/usr/local/lib/python3.6/dist packages/tensorflow/python/client/session.py”,第1244行,在单次运行中
self._call_tf_sessionrun(无,{},[],目标列表,无)
文件“/usr/local/lib/python3.6/dist packages/tensorflow/python/client/session.py”,第1409行,位于调用会话运行中
运行(元数据)
tensorflow.python.framework.errors\u impl.NotFoundError:/home/tree/MEGAsync/PyProj\u right/TransferFineTuneLAB/tensorflow\u toy\u detector/tfdata.tfrecord;没有这样的文件或目录
[[Node:parallel\u read/ReaderReadV2=ReaderReadV2[\u device=“/job:localhost/replica:0/task:0/device:CPU:0”](parallel\u read/TFRecordReaderV2,parallel\u read/filename)]]

我解决了这个问题。它仅仅与数据协议的误用有关。主数据协议是coco,但我试图输入错误的数据集。 因此,错误是因为它无法读取任何数据