Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Issue: ImportError downloading dataset due to unsupported ultralytics version

Đang mở
#251 0 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python

Hướng nghiên cứu

Bắt đầu từ nhánh yolov8 của phương thức Version.download và kiểm tra cách print_warn_for_wrong_dependencies_versions xử lý yêu cầu của ultralytics. So sánh kiểm tra phiên bản nghiêm ngặt hiện tại với hành vi ask_to_continue được báo cáo, sau đó xác minh rằng việc tải xuống dataset hoàn tất với các phiên bản ultralytics mới hơn, trong khi cảnh báo về khả năng tương thích khi triển khai vẫn chính xác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

When attempting to download a dataset using Roboflow's Python package, an ImportError occurs due to a dependency version mismatch with the ultralytics package.

Steps to Reproduce

Click on custom train option and execute recommended code using Roboflow's API:

from roboflow import Roboflow
rf = Roboflow(api_key="MY_API_KEY")
project = rf.workspace("myworkspace").project("myproject")
version = project.version(1)
dataset = version.download("yolov8")
Expected Behavior

The dataset should download without any issues, and the script should handle dependencies smoothly, even with newer versions of ultralytics.

Actual Behavior

The script throws an ImportError, stating a dependency version mismatch:

loading Roboflow workspace...
Dependency ultralytics==8.0.196 is required but found version=8.2.2, to fix: `pip install ultralytics==8.0.196`
Proposed Solution

It would be beneficial for compatibility and future-proofing to support newer versions of ultralytics or at least allow the downloading with a version warning. If possible, updating the dependency requirements or making the version checks more flexible could resolve this issue.

Temporary solution

I added the ask_to_continue argument and set it to True in Version.download method:

...
if model_format == "yolov8":
    # if ultralytics is installed, we will assume users will want to use yolov8 and we check for the supported version  # noqa: E501 // docs
    try:
        import_module("ultralytics")
        print_warn_for_wrong_dependencies_versions([("ultralytics", "==", "8.0.196")], ask_to_continue=True)
    except ImportError:
        print(
            "[WARNING] we noticed you are downloading a `yolov8` datasets but you don't have `ultralytics` installed. "  # noqa: E501 // docs
            "Roboflow `.deploy` supports only models trained with `ultralytics==8.0.196`, to intall it `pip install ultralytics==8.0.196`."  # noqa: E501 // docs
        )
        # silently fail
        pass
...
loading Roboflow workspace...
loading Roboflow project...
Dependency ultralytics==8.0.196 is required but found version=8.2.2, to fix: `pip install ultralytics==8.0.196`
Would you like to continue with the wrong version of ultralytics? y/n: y

Dataset is downlaoded

Additional Information

Python Version: 3.10
Operating System: Windows 10
ultralytics Version: 8.2.2

Thanks :)

Ngôn ngữ chính
Python
Star
629
Fork
140
Merge trung bình
2 ngày 2 giờ
Pull request đã merge (30 ngày)
5

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của roboflow/roboflow-python

Tất cả issue của roboflow/roboflow-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.