Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
emersondelemmus opened this issue May 3, 2022 · 6 comments

Comments

@emersondelemmus
Copy link

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
Copy link

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
Copy link
Author

@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
Copy link

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
Copy link
Author

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
Copy link

callmesora commented May 10, 2022

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
Copy link

I have same problem in yolov7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants