WongKinYiu / yolor

implementation of paper - You Only Learn One Representation: Unified Network for Multiple Tasks (https://arxiv.org/abs/2105.04206)
GNU General Public License v3.0
1.98k stars 524 forks source link

AssertionError: WARNING: No labels found in (userDirectory) ... Cannot train without labels #223

Open emersondelemmus opened 2 years ago

emersondelemmus commented 2 years ago

I have tried every single solution I've come across. YoloR refers you to the Yolov5 method of annotating data. However, creating Yolov5 annotated files on RoboFlow and setting up the directory as suggested by Ultralytics has not worked for me.

Maharshi-joshi commented 2 years ago

annotate data and then make two separate files for images and labels and then in data.yaml file give path to the training and validation data according to wherever you have stored the data and during training give the path of data.yaml in the -data command.

emersondelemmus commented 2 years ago

@Maharshi-joshi I understand that. It is the same directory structure that yolov5 requires. I have used this same directory structure on previous projects, however it still does not recognize my labels. Below is the following input entire terminal output when running the command:

python train.py --batch-size 8 --img 512 --data C:/yoloR_env/RWC_V2_534_images.v2-534_flip_4x4tiles.yolov5pytorch/data.yaml --cfg cfg/yolor_p6_rcw.cfg --weights yolor_p6.pt --device 0 --name yolor_p6 --hyp hyp.scratch.1280.yaml --epochs 300

Capture

Maharshi-joshi commented 2 years ago

It is suggesting that it is empty. Are your labels in .txt format? Can you open and confirm that there are dimensions and labels in the labels file?

emersondelemmus commented 2 years ago

Correct, my labels are in a .txt format as follows: imageName.txt where imageName matches the actual image file name (.jpg).

The dimensions and class in each .txt file follow this format: 0 0.197265625 0.015625 0.01953125 0.03125 0 0.283203125 0.3819444444444444 0.01953125 0.2986111111111111

Labels were done and exported in roboflow (as recommended by yoloR & yolov5).

My directory structure is also the same as recommended by YoloR. https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data#13-organize-directories

callmesora commented 2 years ago

I have the same exact problem.. which is weird since I just used the same dataset to train Scaled Yolov4 and Yolov5 Without any problem.

This solved my problem

36

PranavChakane commented 1 year ago

I have same problem in yolov7.