I was following this instruction to train custom dataset:
https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data
And I have the dataset downloaded by running get_coco_dataset.sh
I tried to use the given coco_1cls.data as the training data with the given yolov3-1cls.cfg as the cfg file
My input command was:
python train.py --data data/coco_1cls.data --cfg cfg/yolov3-1cls.cfg
And what I got was this:
Traceback (most recent call last):
File "train.py", line 341, in
multi_scale=opt.multi_scale,
File "train.py", line 147, in train
multi_scale=multi_scale)
File "F:\yolo\nest\utils\datasets.py", line 208, in __init__
assert len(np.concatenate(self.labels, 0)) > 0, 'No labels found. Incorrect label paths provided.'
AssertionError: No labels found. Incorrect label paths provided.
I am using PyCharm 2019,1,2 on Windows 10
Has anyone experienced this issue?
@YxChen98 the error message is self-explanatory: No labels found. Incorrect label paths provided
The command works perfectly if you set up your environment correctly.
https://colab.research.google.com/drive/1G8T-VFxQkjDe4idzN8F-hbIBqkkkQnxw#scrollTo=R51pP88Rj02x
!python train.py --data data/coco_1cls.data --cfg cfg/yolov3-1cls.cfg
Namespace(accumulate=4, backend='nccl', batch_size=16, cfg='cfg/yolov3-1cls.cfg', data_cfg='data/coco_1cls.data', dist_url='tcp://127.0.0.1:9999', epochs=68, evolve=False, img_size=416, multi_scale=False, nosave=False, notest=False, num_workers=4, rank=0, resume=False, transfer=False, var=0, world_size=1)
Using CUDA device0 _CudaDeviceProperties(name='Tesla T4', total_memory=15079MB)
Model Summary: 222 layers, 6.15237e+07 parameters, 6.15237e+07 gradients
Epoch Batch xy wh conf cls total targets time
0/67 0/0 0.238 0.342 49.3 0 49.8 17 3.67
Reading image shapes: 100% 5/5 [00:00<00:00, 7332.70it/s]
Class Images Targets P R mAP F1
Computing mAP: 100% 1/1 [00:01<00:00, 1.73s/it]
all 5 17 0 0 0 0
Epoch Batch xy wh conf cls total targets time
1/67 0/0 0.215 0.391 49.3 0 49.9 15 8.23
Class Images Targets P R mAP F1
Computing mAP: 100% 1/1 [00:00<00:00, 1.02it/s]
all 5 17 0 0 0 0
...
I got it solved.
The coco_1cls.txt needs some change:
I changed the previous
../coco/images/val2014/COCO_val2014_000000001464.jpg
to
./data/images/val2014/COCO_val2014_000000001464.jpg
and it works
Hello, I got the same problem under win10.
Chen, I gusse you put the images and labels into the /data. And I did the same thing as you.
那么老哥可以加个qq嘛, save me pls.
@MrDavinci in the custom training tutorial yolov3 and coco and folders at the same level, they exist next to each other.
https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data
I caught the same question one hours ago, and I finally find the reason is that my picture path in data/train.txt & data/collector.name & data/collector.data is relative path, I changed it to absolute path like names=C:\Users\27319\Documents\GitHub\yolov3-master\data\collector.names, the problem would be solved!
I caught the same question one hours ago, and I finally find the reason is that my picture path in data/train.txt & data/collector.name & data/collector.data is relative path, I changed it to absolute path like names=C:\Users\27319\Documents\GitHub\yolov3-master\data\collector.names, the problem would be solved!
Most helpful comment
Hello, I got the same problem under win10.
Chen, I gusse you put the images and labels into the /data. And I did the same thing as you.
那么老哥可以加个qq嘛, save me pls.