Yolov3: 'No labels found' after 'Caching labels'

Created on 8 Apr 2020  路  11Comments  路  Source: ultralytics/yolov3

馃悰 Bug

I work in JupyterLab. I am trying to train with custom data. I have the exact same copy of my directory structure that Train Custom Data showed with Coco. The training stops with 'No labels found' after 'Caching labels'.

k茅p

Any idea on this?
Thanks.

bug

Most helpful comment

@emmbertelen I updated the error message to show you exactly where it is looking in f54d28ba637a8ec7259bc51d7f3f956b1b382871

If you git pull and try again it will show you the search folder.

You should use the directory structure established in the tutorial and go from there.

All 11 comments

I run into the same error like you emmbertelen, but I work on linux, not jupyter.

I also got the same error.

I resolved it.
Image path should be

./coco/images/train100.jgp'
not 
../coco/images/train100.jgp'

remove one '.' from class files.

but you put the coco folder outside of yolo folder, right?

but you put the coco folder outside of yolo folder, right?

Inside the yolo folder where train.py exists.

all paths are relative to the yolov3 folder. In the tutorials the coco folder is alongside the yolov3 folder, not inside it.

@glenn-jocher I also tried with coco. I left everything as it is in the tutorial. I tried with the image set of data/coco1cls.txt, and coco alongside with yolo. Only created a coco1.names file with one class in it, and a coco1cls.data file:
k茅p

And the training died just like before:

k茅p

@emmbertelen I updated the error message to show you exactly where it is looking in f54d28ba637a8ec7259bc51d7f3f956b1b382871

If you git pull and try again it will show you the search folder.

You should use the directory structure established in the tutorial and go from there.

For example, if I rename my coco folder and try to train, I see this. This path is relative to the yolov3 folder.

Namespace(accumulate=4, adam=False, batch_size=16, bucket='', cache_images=False, cfg='cfg/yolov3-spp.cfg', data='data/coco16.data', device='', epochs=300, evolve=False, img_size=[416], multi_scale=False, name='', nosave=False, notest=False, rect=False, resume=False, single_cls=False, weights='weights/yolov3-spp-ultralytics.pt')
Using CPU

Run 'tensorboard --logdir=runs' to view tensorboard at http://localhost:6006/
Model Summary: 225 layers, 6.29987e+07 parameters, 6.29987e+07 gradients
Caching labels: 100%|鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 16/16 [00:00<00:00, 86928.58it/s]
Traceback (most recent call last):
  File "/Users/glennjocher/PycharmProjects/yolov3/train.py", line 425, in <module>
    train()  # train normally
  File "/Users/glennjocher/PycharmProjects/yolov3/train.py", line 178, in train
    single_cls=opt.single_cls)
  File "/Users/glennjocher/PycharmProjects/yolov3/utils/datasets.py", line 382, in __init__
    assert nf > 0, 'No labels found in %s. See %s' % (os.path.dirname(file) + os.sep, help_url)
AssertionError: No labels found in ../coco/labels/train2017/. See https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data

@glenn-jocher Thank you very much for your help, it made me identify the problem. My "parent" directory, where I stored my custom images and labels was: 'tower_images'. And look at this: datasets.py replaced every "images" in the path. Im not sure if it is a bug, but this is one of the most hilarious thing that was blocking me for 2 days... Btw Im very thankful for your work and for this yolo implenetation, it really inspires me.
k茅p
So after all, I renamed my dataset's directory, and now it trains.

@emmbertelen ah great! No this is not a bug, it searches for /labels/ next to an /images/ folder.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rajasekhar06 picture Rajasekhar06  路  3Comments

cyberclone12 picture cyberclone12  路  4Comments

Aria20155 picture Aria20155  路  3Comments

Blddwkb picture Blddwkb  路  4Comments

kaaier picture kaaier  路  3Comments