You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It raised exception that the label files had not been found:
Traceback (most recent call last):
File "test_half.py", line 257, in <module>
opt.augment)
File "test_half.py", line 64, in test
dataset = LoadImagesAndLabels(path, img_size, batch_size, rect=True, single_cls=opt.single_cls)
File "/path/to/PyTorch_YOLOv4/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 ./labels/val2017/. See https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data
By diving into the problem, I found it was caused by relative path.
For the coco2017 dataset, the zip file coco2017labels.zip download from data/get_coco2017.sh contains files:
Problem
When I run the basic demo script:
It raised exception that the label files had not been found:
By diving into the problem, I found it was caused by relative path.
For the coco2017 dataset, the zip file
coco2017labels.zip
download fromdata/get_coco2017.sh
contains files:The content of
val2017.txt
is like this:Here, the paths of images are relative, so the script could not find the label file.
Solution
Refered to Yolov5 project, we can add two line in
utils/database.py
to support the relative path:I have create a pull request #32
The text was updated successfully, but these errors were encountered: