我正在尝试使用darkflow训练微小的yolo。但是,当我运行代码时,会收到此错误:
make_a_2 <- function(x) {
force(x)
a <- function(y) {
x + y
}
a
}
如果删除图像,即使所有图像的大小均正常,它也会找到另一个大小为0,0的图像。如果我不删除它,它将告诉我大小为0,0的其他图像。意思是它随机发生?我删除了几张图片,但是我不确定这是否会一直持续下去,或者不确定是否有一定数量的图片的大小为“ 0,0”。
这是我从darkflow-master目录中一直使用的命令:
Enter training ...
cfg/tiny-yolo-voc-2c.cfg parsing images/annotation
Parsing for ['thumbs_down', 'thumbs_up']
[====================>]100% 001296.xml
Statistics:
thumbs_down: 2078
thumbs_up: 1681
Dataset size: 2470
Dataset of 2470 instance(s)
This image's width or height are zeros: 002149.png
train_instance: ['002149.png', [0, 0, [['thumbs_up', 112, 15, 204, 143]]]]
Please remove or fix it then try again.
Traceback (most recent call last):
File "/anaconda3/bin/flow", line 6, in <module>
cliHandler(sys.argv)
File "/anaconda3/lib/python3.6/site-packages/darkflow/cli.py", line 33, in cliHandler
print('Enter training ...'); tfnet.train()
File "/anaconda3/lib/python3.6/site-packages/darkflow/net/flow.py", line 39, in train
for i, (x_batch, datum) in enumerate(batches):
File "/anaconda3/lib/python3.6/site-packages/darkflow/net/yolo/data.py", line 114, in shuffle
inp, new_feed = self._batch(train_instance)
File "/anaconda3/lib/python3.6/site-packages/darkflow/net/yolov2/data.py", line 35, in _batch
cx = centerx / cellx
ZeroDivisionError: float division by zero
答案 0 :(得分:0)
请参见上述错误消息的第12行:
['002149.png',[0,0,[['thumbs_up',112,15,204,143]]]
此列表来自注释文件。第二和第三值是图像宽度和图像高度。您可以看到它们都为零。因此,我建议您检查批注文件是否正确。
侧面说明: