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

Fix YOLOv8 validation when custom dataset yaml is provided #1528

Merged
merged 3 commits into from
Apr 20, 2023

Conversation

anmarques
Copy link
Member

The pycocotools pathway for model validation expects a "Path" object for the data['path'] entry. When the user provides a complete path to a yaml file (or when --dataset-path is provided) this entry remains a string, which leads to an error when doing the pycocotools evaluation.

This is a failure on ultralytics side, but we can fix in the integration since we override the validator class.

Testing plan: The fix allowed me to use "dataset-path" as below:
sparseml.ultralytics.val
--model zoo:cv/detection/yolov8-n/pytorch/ultralytics/coco/base-none
--data coco.yaml
--dataset-path /home/alexandre/datasets/coco

(dataset-path is implemented by 1. copying ultralytics' coco.yaml to the local path, 2. overwriting the dataset path in the yaml file, 3. replacing the data argument with the complete path to edited yaml file.)

dbogunowicz
dbogunowicz previously approved these changes Apr 20, 2023
@anmarques anmarques merged commit ad82f3b into main Apr 20, 2023
@anmarques anmarques deleted the fix/yolov8/data_path branch April 20, 2023 19:01
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

Successfully merging this pull request may close these issues.

None yet

3 participants