使用 tf-Faster-RCNN 进行对象检测时出现 InvalidArgumentError

InvalidArgumentError while using tf-Faster-RCNN for object detection

我在使用 tensorflows Faster-RCNN 进行对象检测时遇到以下错误:

"InvalidArgumentError : ValueError: attempt to get argmax of an empty sequence  [[Node: model/rpn/target/PyFunc = PyFunc[Tin=[DT_FLOAT, DT_INT32, DT_INT32, DT_INT32, DT_INT32], Tout=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], token="pyfunc_0", _device="/job:localhost/replica:0/task:0/cpu:0"](model/rpn/cls/conv_1/Mul/_2579, _arg_Placeholder_2_0_2, _arg_Placeholder_1_0_1, model/rpn/target/PyFunc/input_3, model/rpn/target/PyFunc/input_4)]]
 [[Node: losses/fast_rcnn_cls_loss/SparseSoftmaxCrossEntropyWithLogits/Shape/_2565 = _HostRecv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_5640_losses/fast_rcnn_cls_loss/SparseSoftmaxCrossEntropyWithLogits/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"]()]]".

我已经检查过我的所有图像都包含有效的边界框。我该如何解决这个问题?

TL;DR: 从您的数据中删除零宽度边界框,也从 the caches[=14= 中删除]


当我收到此错误时,我正在使用基于 Fast(er)-RCNN 的 CTPN 文本检测器。

我注意到我的一些边界框有 width=0。所以我清理了它们,但错误仍然存​​在。更改未反映出来,因为代码正在使用缓存。所以我从 data 文件夹中删除了缓存并重新运行代码。

希望这对某人有所帮助。