Open Basim592003 opened 2 weeks ago
π Hello @Basim592003, thank you for your interest in Ultralytics YOLOv8 π! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.
If this is a π Bug Report, please provide a minimum reproducible example to help us debug it.
If this is a custom training β Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.
Join the vibrant Ultralytics Discord π§ community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.
Pip install the ultralytics
package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.
pip install ultralytics
YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.
Hello! It looks like the issue may be related to where the model is looking for your label files. Based on the error message you're receiving, it's possible that the labels are not correctly matched or located where the model expects.
First, ensure that your labels in D:\UNIVERSITY\SEM6\Mia\data\labels\train
match the images in D:\UNIVERSITY\SEM6\Mia\data\images\train
in terms of naming and format. Each label file should have the same basename as its corresponding image file.
Also, in your training YAML file, you should specify the location of both the images and labels directories explicitly. Here's a suggested correction for your YAML configuration:
path: D:/UNIVERSITY/SEM6/Mia/data
train: images/train
val: images/val # Make sure to validate on different data if possible
# Directories
train_label_dir: labels/train
val_label_dir: labels/val
# Classes
names:
- probes
Make sure the train_label_dir
and val_label_dir
are correctly pointing to where your labels are stored.
Try these adjustments and see if it resolves the issue. π
hi @Basim592003
from ultralytics import YOLO
model = YOLO("yolov8s.yaml")
results = model.train(data=r"D:\UNIVERSITY\SEM6\Mia\config.yaml", epochs=1)
I guess would be line 2, you might not add proper format for model
i tried adding label directories as you said but it still gives the same error. Also why is a cache being created and why does it look for labels in thee created cache? train: New cache created: D:\UNIVERSITY\SEM6\Mia\Training\Images\Train.cache WARNING β οΈ No labels found in D:\UNIVERSITY\SEM6\Mia\Training\Images\Train.cache
@Basim592003 hello!
For the issue where you're encountering missing labels even after specifying the directories, it sounds like there might be a disconnect in how the paths are referenced in your configuration. Hereβs a quick checklist:
labels
folder structure mirrors that of your images
. Each label file name should exactly match its corresponding image file name, except the extension..txt
file for YOLO.Regarding the cache, YOLO creates a .cache
file to speed up subsequent trainings by saving the loaded datasets. It's checking the cache for labels, implying possibly the cache didn't store paths correctly the first time or the labels are indeed missing/incorrectly named.
If the issue persists, try clearing the cache by deleting the .cache
file, and rerun your training. Make sure your paths in the YAML are correct and double-check any typographical errors.
Hope this helps!
@glenn-jocher Hey! Both my labels and images files content have the same exact names. And yes, i have also tried deleting the .cache file and running but i get the same results.
Maybe its because the images i am using are tiff images ?
Search before asking
Question
i am trying to detect cells but it keeps throwing this error -> WARNING β οΈ No labels found in D:\data\labels\train.cache. i have images and labels folder set up like specified from yolo documentations bur still have an issue.
Additional
--python code-- from ultralytics import YOLO model = YOLO("yolov8s.yaml") results = model.train(data=r"D:\UNIVERSITY\SEM6\Mia\config.yaml", epochs=1)
--yaml file-- path: D:/UNIVERSITY/SEM6/Mia/data train: images/train
val: images/train
Classes
names: 0: probes