Open palmcorp opened 5 months ago
Hello!
Thank you for providing detailed information about your issue. It looks like you're encountering a problem with label format during the training phase of your YOLOv8-pose model. Let's address your concerns step-by-step.
The error message indicates that your labels require 15 columns each, but the provided labels do not match this requirement. For pose estimation, the label format should follow the structure outlined in the Ultralytics documentation:
Format with Dim = 2:
<class-index> <x> <y> <width> <height> <px1> <py1> <px2> <py2> ... <pxn> <pyn>
Format with Dim = 3:
<class-index> <x> <y> <width> <height> <px1> <py1> <p1-visibility> <px2> <py2> <p2-visibility> ... <pxn> <pyn> <pn-visibility>
Given your kpt_shape: [5, 2]
, each label should have:
This totals to (1 + 4 + (5 \times 2) = 15) columns per label.
Your sample labels should look like this:
0 0.680863 0.595223 0.20369 0.0726488 0.579017 0.631547 0.687827 0.609047 0.748973 0.590758 0.782708 0.558898 0.6325 0.624151
Ensure your YAML files correctly reflect the dataset structure and keypoints configuration. Here’s a simplified version of your data5.yaml
:
# Data
path: /content/datasets/echo-pose
train: images/train2017
val: images/val2017
# Keypoints
kpt_shape: [5, 2] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
flip_idx: [0, 1, 2, 3, 4] # no flipping
# Classes
names:
0: Class0
1: Class1
2: Class2
3: Class3
4: Class4
torch
and ultralytics
. You can update them using:
pip install --upgrade torch ultralytics
Here’s a snippet to help you get started with training after ensuring your labels and configurations are correct:
from ultralytics import YOLO
# Load a pretrained model
model = YOLO('yolov8n-pose.pt')
# Train the model
results = model.train(data='/content/YAML/data5.yaml', epochs=100, imgsz=640)
Feel free to reach out if you have any more questions or need further assistance. Happy training! 🚀
Hi Paula,
Thanks again for excellent guidance, will look into these issues today and update comments.
Best
Paul
From: Paula Derrenger @.*** Sent: Monday, June 10, 2024 11:45 PM To: ultralytics/JSON2YOLO Cc: Paul Petronelli; Author Subject: Re: [ultralytics/JSON2YOLO] Yolov8 rejecting labels during model.training (Issue #94)
Hello!
Thank you for providing detailed information about your issue. It looks like you're encountering a problem with label format during the training phase of your YOLOv8-pose model. Let's address your concerns step-by-step.
Label Format Issue
The error message indicates that your labels require 15 columns each, but the provided labels do not match this requirement. For pose estimation, the label format should follow the structure outlined in the Ultralytics documentation https://docs.ultralytics.com/datasets/pose/ :
Format with Dim = 2:
Hi Paul,
Thank you for your kind words and for your continued efforts in resolving this issue. 😊
To ensure we can assist you effectively, please verify a couple of things:
Label Format: Double-check that all your label files strictly follow the required format for pose estimation. Each label should have 15 columns, as outlined previously.
Package Versions: Ensure you are using the latest versions of torch
and ultralytics
. You can update them with:
pip install --upgrade torch ultralytics
Minimum Reproducible Example: If the issue persists, could you please provide a minimum reproducible code example? This will help us investigate the problem more effectively. You can find guidelines on how to create one here.
Here’s a quick example to get you started with training after ensuring your labels and configurations are correct:
from ultralytics import YOLO
# Load a pretrained model
model = YOLO('yolov8n-pose.pt')
# Train the model
results = model.train(data='/content/YAML/data5.yaml', epochs=100, imgsz=640)
Feel free to reach out if you have any more questions or need further assistance. The YOLO community and the Ultralytics team are here to help!
CASE: Yolov8-pose rejecting labels during training QUESTION: Where does yolov8 determine how many columns are required for each label?
ERROR at model.train phase:
train: WARNING ⚠️ /content/datasets/echo-pose/images/train2017/frame_000151.PNG: ignoring corrupt image/label: labels require 15 columns each
SAMPLE LABELS FROM train2017: 0 0.680863 0.595223 0.20369 0.0726488 0.579017 0.631547 2 0.687827 0.609047 2 0.748973 0.590758 2 0.782708 0.558898 2 0.6325 0.624151 2
0 0.659062 0.613906 0.23378 0.0539435 0.542172 0.640877 2 0.645104 0.61308 2 0.714791 0.617574 2 0.775952 0.586934 2 0.589449 0.637366 2