-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: non-normalized or out of bounds coordinate labels: #658
Comments
Your labels are not in the correct coco-format. |
Do you meant about the directory structure of coco or the label.txt file ? Label.txt is following format Class_id Xmin Ymin width height |
@Samjith888 see https://docs.ultralytics.com/yolov5/tutorials/train_custom_data Each row is |
My label.txt is like following And the image resolution is 4096 *2160 Through normalizing the x_center y_center width height values, we can convert it into 0-1 range values. While training, how this model will locate our ROI from the 4096 *2160 resolution image by using the normalized values (between 0-1)?? |
@Samjith888 we've updated the Custom Training Example in the wiki with directions for normalizing. All labels must be normalized otherwise training will not work. |
Values before normalizing After Normalization I have followed the instructions in the wiki for normalizing the values. And the image resolution is 4096 2160 (wh). But i got the width value is greater than one (1.0449123555555557) even after normalization. |
@Samjith888 well maybe your image width and height are switched, or your original coordinates are xyxy rather than xywh. |
Getting the following error after solving the above error
I have 7 classes ,hence filter= 36. I have changed the classes and filter values in 3 fields of the yolov3.cfg file. |
@Samjith888 you may want to try loading the pytorch weights instead |
@Samjith888 hi ,have you succeed? |
This problem arises when the bounding box coordinate(s) is(are) greater than the respective image dimension(s). For Instance: My image dimensions are 640 (width) x 512 (height) and due to some reason, my bounding box coordinates are xmin = 600, ymin = 450, xmax = 660, ymax = 510. In the above example it can be seen that xmax > 640 and after normalizing, the result wouldn't be between 0-1. It would be greater than 1. This kind of situation is the cause of this error. |
Got the following error while running for custom data with 7 classes. https://github.com/ultralytics/yolov3/issues/569 .
$ python train.py --data data/coco.data
Namespace(accumulate=2, adam=False, arc='default', batch_size=32, bucket='', cache_images=False, cfg='cfg/yolov3-spp.cfg', data='data/coco.data', device='', epochs=273, evolve=False, img_size=416, img_weights=False, multi_scale=False, name='', nosave=False, notest=False, prebias=False, rect=False, resume=False, transfer=False, var=None, weights='weights/ultralytics49.pt')
Using CUDA device0 _CudaDeviceProperties(name='GeForce GTX 1070', total_memory=8116MB)
AssertionError: non-normalized or out of bounds coordinate labels:
Reading labels: 0%| | 0/1562 [00:00<?, ?it/s]Traceback (most recent call last):
File "train.py", line 444, in
train() # train normally
File "train.py", line 193, in train
cache_images=False if opt.prebias else opt.cache_images)
File "/home/samjth/Desktop/yolov3/utils/datasets.py", line 335, in init
assert (l[:, 1:] <= 1).all(), 'non-normalized or out of bounds coordinate labels: %s' % file
AssertionError: non-normalized or out of bounds coordinate labels: /home/samjth/Desktop/yolov3/data/coco/labels/train2014/073m_WW_5049.txt
Reading labels: 0%| | 0/1562 [00:00<?, ?it/s]
(base)
The text was updated successfully, but these errors were encountered: