roboflow / roboflow/roboflow-python

Incorrect Data Path in YOLOv8 Dataset Configuration

Open
#240 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
629
Forks
140
Avg merge
2d 2h
Merged PRs (30d)
5

Description

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



Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the download using the Roboflow Python client and the provided YOLOv8 example, then inspect the generated TennisBallTracker-9/data.yaml and its train, validation, and test paths. Compare those paths with the downloaded directory structure and the reported Ultralytics settings path; done means a freshly downloaded dataset trains without manually editing data.yaml.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.