notebooks
notebooks copied to clipboard
Roboflow - ultralytics error with dataset path
Search before asking
- [X] 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!
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
...
)
@venkatram-dev I've followed your suggested approach and encountered the same error
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.
I downgraded to those specific versions and now no error! These are object detection annotations as yolov8 format from Roboflow
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!