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

Closed
1 of 2 tasks
robmarkcole opened this issue Sep 4, 2024 · 5 comments
Closed
1 of 2 tasks

Roboflow - ultralytics error with dataset path #306

robmarkcole opened this issue Sep 4, 2024 · 5 comments
Labels
bug Something isn't working onsite The change was suggested during an initiative on a company onsite

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.

@robmarkcole
Copy link
Author

I downgraded to those specific versions and now no error!
These are object detection annotations as yolov8 format from Roboflow

@LinasKo
Copy link
Contributor

LinasKo commented Oct 24, 2024

We've now verified which versions are required to train, validate, deploy and infer with yolov8. Notebooks are updated - let us know if there's further issues!

@LinasKo LinasKo closed this as completed Oct 24, 2024
@LinasKo LinasKo added the onsite The change was suggested during an initiative on a company onsite label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working onsite The change was suggested during an initiative on a company onsite
Projects
None yet
Development

No branches or pull requests

3 participants