ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.78k stars 16.36k forks source link

AssertionError: negative labels: #857

Closed shliang0603 closed 4 years ago

shliang0603 commented 4 years ago

@glenn-jocher when I train my custom dataset in yolov5 v3.0, The following error occurred:

image

Can you give me some advice ?

github-actions[bot] commented 4 years ago

Hello @shliang0603, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom model or data training question, please note Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

For more information please visit https://www.ultralytics.com.

Aktcob commented 4 years ago

This repo doesn't support ignore(negative label -1 means ignore) labels right now.

shliang0603 commented 4 years ago

@Aktcob Thanks for your reply, I don't quite understand what you mean by negative label. I annotate the data set using the Labelimg tool, but the other previously annotated data sets have no problem in training

010854.txt label info:

22 0.4216666666666667 0.33 -0.7366666666666667 0.35333333333333333
22 0.415 0.6283333333333333 -0.6966666666666667 0.33666666666666667

And the annotation image 010854.jpg is as follows: image

Aktcob commented 4 years ago

Sorry. I made a mistake.

The reason is -0.7366666666666667<0, the x1y1x2y2 should be in 0~1

ChBrockmann commented 4 years ago

@Aktcob You are basically correct, but I just want to tell you, that those are not x1y1x2y2 values. Those are numbers in the normalized xywh format. Meaning: x_center y_center width height For more Information you should check out: #12

Aktcob commented 4 years ago

@ChBrockmann Danke~

glenn-jocher commented 4 years ago

@Aktcob I made a new graphic to explain the normalized xywh labels. All classes must be >=0, and all box coordinates must also be 1 >= x >= 0. Does this explain it better?

I'll update the custom training tutorials with this so it's less confusing.

zidane_anotated

shliang0603 commented 4 years ago

@Aktcob @glenn-jocher Thanks for your reply, I've got the problem.

sp7414 commented 4 years ago

你好,我也遇到了和您一样的问题,同样报错AssertionError: negative labels: data/coco/labels/train2017/000016_4.txt,检查发现确实存在负值,请问您解决了这个问题吗?可以分享一下吗,谢谢

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.