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

Incorrect Data Path in YOLOv8 Dataset Configuration #240

Open
tomershukhman opened this issue Mar 13, 2024 · 3 comments
Open

Incorrect Data Path in YOLOv8 Dataset Configuration #240

tomershukhman opened this issue Mar 13, 2024 · 3 comments

Comments

@tomershukhman
Copy link

Bug Report: Incorrect Data Path in YOLOv8 Dataset Configuration

Description

While using the Roboflow Python client to download a YOLOv8 dataset for a tennis ball tracking project, I encountered an issue with the generated data.yaml file. The file's paths were incorrectly set, leading to a RuntimeError when attempting to train the YOLO model.

Steps to Reproduce

Download the dataset using the Roboflow Python client:

from roboflow import Roboflow
rf = Roboflow(api_key="YOUR_API_KEY")
project = rf.workspace("denica-tran").project("tennisballtracker")
version = project.version(9)
dataset = version.download("yolov8")

from ultralytics import YOLO
model = YOLO('yolov8n.pt')

dataset_path ="TennisBallTracker-9/data.yaml"
model.train(data=dataset_path, epochs=5)

Observe the downloaded TennisBallTracker-9 folder with the standard YOLOv8 dataset structure.
Check the data.yaml file, which incorrectly references paths for training, validation, and test images.
Expected Behavior
The data.yaml file should correctly point to the respective image directories within the dataset folder.

Actual Behavior

The data.yaml file contains incorrect paths, leading to a RuntimeError when the YOLO model attempts to access the image directories:

RuntimeError: Dataset 'TennisBallTracker-9/data.yaml' error ❌ 
Dataset 'TennisBallTracker-9/data.yaml' images not found ⚠️, missing path '/.../android_figurine/datasets/TennisBallTracker-9/TennisBallTracker-9/valid/images'
Note dataset download directory is '/..../android_figurine/datasets'. You can update this in '/..../Ultralytics/settings.yaml'

TL;DR

The issue might be related to residual settings from a previous project (android_figurine) that seems to interfere with the current dataset configuration. It's unclear why the old dataset path is being referenced.

Temporary Solution

I modified the data.yaml file manually to correct the paths, which allowed the training to proceed successfully:

names:

ankle
court
elbow
eye
hand
head
hip
knee
net
nose
person
player
shoulder
tennis ball
tennis racket
nc: 15
path: /..../TennisBallTracker-9/
test: test/images
train: train/images
val: valid/images

Environment

Python version: 3.12



@xy-23
Copy link

xy-23 commented Apr 9, 2024

same problem

@Ricerob
Copy link

Ricerob commented Apr 18, 2024

Hey @tomershukhman . Did some digging around the source code and struggled to see if this was an Ultralytics issue or a pathing issue in Roboflow. Did changing the ultralytics settings affect anything? If not, can you check your environment variables for a DATASET_DIRECTORY? If you don't provide a location in version.download(), it will check the environment for this variable and use it for pathing, rather than defaulting on just the filename.

@guiaugustoga987
Copy link

I posted this error in ultralytics repository and this was their response.

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