Issue: ImportError downloading dataset due to unsupported ultralytics version
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
- Lĩnh vực
- computer-vision, machine-learning
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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của roboflow/roboflow-python
-
RLE segmentation mask visible in dataset thumbnail, but invisible in annotation preview/editor Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
roboflow/roboflow-python#505 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
roboflow/roboflow-python#433 ·
-
Dataset Download Stuck Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
roboflow/roboflow-python#429 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
roboflow/roboflow-python#427 · 1 bình luận ·
-
Inability to upload raw bytes Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
roboflow/roboflow-python#426 ·
Tất cả issue của roboflow/roboflow-python
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stephrobert/dsoxlab#238 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sublimehq/package_control#1780 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nwg-piotr/nwg-displays#145 ·