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

Roboflow - ultralytics error with dataset path #306

Open
1 of 2 tasks
robmarkcole opened this issue Sep 4, 2024 · 3 comments
Open
1 of 2 tasks

Roboflow - ultralytics error with dataset path #306

robmarkcole opened this issue Sep 4, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@robmarkcole
Copy link

robmarkcole commented Sep 4, 2024

Search before asking

  • I have searched the Roboflow Notebooks issues and found no similar bug report.

Notebook name

Yolov8 custom dataset, but using the python api. Dataset path is apparently incorrect. I know I've had this issue in the past

Bug

I download the dataset

rf = Roboflow(api_key="xx")
project = rf.workspace("org").project("simulated-data")
version = project.version(1)
dataset = version.download("yolov8")

# validate location
dataset.location == '/teamspace/studios/this_studio/simulated-data'

# Now I should be able to train with 
 # Loading a pretrained model
model = YOLO('yolov8l.pt')

# Training the model
model.train(
    data = f'{dataset.location}/data.yaml', # this is correct
...
)

But I get an error:

RuntimeError: Dataset '/teamspace/studios/this_studio/simulated-data/data.yaml' error ❌ 

Dataset '/teamspace/studios/this_studio/simulated-data/data.yaml' images not found ⚠️, 

missing path '/teamspace/studios/this_studio/simulated-data/simulated-data/valid/images'

Why is it looking in a nested directory?

Environment

Lightning studio

Minimal Reproducible Example

See above

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@robmarkcole robmarkcole added the bug Something isn't working label Sep 4, 2024
@venkatram-dev
Copy link
Contributor

By default the default datasets directory is set to 'datasets_dir': str(root / 'datasets'),

https://github.com/roboflow/ultralytics-roboflow/blob/main/ultralytics/yolo/utils/__init__.py#L365

Please create this folder datasets like below , navigate to that folder and then download the data .
Below is a sample from google colab notebook.

import os
HOME = os.getcwd()
print(HOME)

!mkdir {HOME}/datasets
%cd {HOME}/datasets

After that download

rf = Roboflow(api_key="xx")
project = rf.workspace("org").project("simulated-data")
version = project.version(1)
dataset = version.download("yolov8")

optional step : validate that data is downloaded under datasets directory

!ls -ltr $HOME/datasets

dataset.location will point to a directory like simulated-data-1 under $HOME/datasets

Run Training

 # Loading a pretrained model
model = YOLO('yolov8l.pt')

# Training the model
model.train(
    data = f'{dataset.location}/data.yaml', # this is correct
...
)



@robmarkcole
Copy link
Author

@venkatram-dev I've followed your suggested approach and encountered the same error

@venkatram-dev
Copy link
Contributor

Oh interesting.
I used roboflow-1.1.44 and ultralytics==8.0.196
Please try to use the same versions and see if you still get the errors.

Also, can you share how was the data uploaded and annotated?

Since I am not able to reproduce ,to debug further, Please share a google colab with exact code and error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants