首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Darkflow表示图像的大小为0

Darkflow表示图像的大小为0
EN

Stack Overflow用户
提问于 2018-12-02 20:17:57
回答 1查看 558关注 0票数 0

我在试着用暗流训练小yolo。然而,当我运行代码时,我收到了这个错误:

代码语言:javascript
复制
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的图像,即使所有图像的大小都是正常的。如果我不删除它,它会告诉我一个不同的大小为0,0的图像。意思是它是随机通过的?我删除了几张图片,但我不确定这是否会永远持续下去,或者是否只有一定数量的图片的“大小为0,0”。

这是我在darkflow-master目录中使用的命令:

代码语言:javascript
复制
flow --model cfg/tiny-yolo-voc-2c.cfg --labels images/annotation/classes.txt --train --trainer adam --load bin/tiny-yolo-voc.weights --annotation images/annotation --dataset images/images --gpu 1.0 --epoch 1000
EN

回答 1

Stack Overflow用户

发布于 2018-12-18 21:40:57

请参见上述错误消息的第12行:

['002149.png',[0,0,[‘拇指向上’,112,15,204,143]

此列表来自注释文件。第二和第三个值是图像宽度和图像高度。你可以看到它们都是零。因此,我建议您检查注释文件是否正确。

附注:

  1. '002149.png‘:图片文件名
  2. (0,0):图片宽度和高度respectively
  3. 'thumbs_up’:类名
  4. (112,15):绝对中心coordnates
  5. (204,143):真值框

的绝对宽度和高度

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53580151

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档