0

I'm trying to train tiny yolo using darkflow. However when I run the code I receive this error:

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

If I delete the image, it finds another image that has sizes of 0,0 even though all the images have normal sizes. And if I don't delete it, it tells me a different image having the size of 0,0. Meaning that it goes through randomly? I deleted a couple of images, but I'm unsure whether this'll go on forever, or if there are just a certain amount of images that have "size 0,0".

This is the command I've been using from my darkflow-master directory:

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

1 Answers1

0

Please see the line 12 of the above error message:

['002149.png', [0, 0, [['thumbs_up', 112, 15, 204, 143]]]]

This list comes from the annotation file. The second and third values are image width and image height. You can see that they are both zero. So I recommend you to check the annotation file if it is correct.

SIDE NOTE:

  1. '002149.png' : image file name
  2. (0, 0) : image width and height respectively
  3. 'thumbs_up' : class name
  4. (112, 15): absolute center coordnates
  5. (204, 143): absolute width and height of the truth box
spl
  • 411
  • 5
  • 8