-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
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
torchhub load model python version restriction #3543
Comments
@LIU-FAYANG unfortunately 3.6.9 doesn't pass CI checks currently. It looks like the cause is inability to install pycocotools>2.0 with python 3.6.9. I'll think about how to work around this! |
@LIU-FAYANG I think the best approach would be to comment pycocotools in requirements.txt and insert a special check_requirements call in test.py right before pycocotools is imported. I think 3.6.9 might pass CI after these updates. I will try to implement these changes today. TODO: install pycocotools on-demand only. |
@LIU-FAYANG I've updated pycocotools handling in #3547, and merged updated master into #3375, which is now running CI tests on all python versions. If the 3.6.9 tests pass, I will create a new PR to reduce the YOLOv5 python requirement to 3.6.9, and then this issue should be resolved. |
@LIU-FAYANG good news 😃! Your original issue may now be fixed ✅ in PRs #3547 and #3548. Python minimum version reduced to 3.6.2. To receive this update:
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀! |
@glenn-jocher Hi, it works now, thanks for your kind help! :) |
@LIU-FAYANG great, glad to hear it! Let us know if you run into any other problems :) |
❔Question
Hi, it looks similar to the model loading opencv-python problem, could you help cancel the pytorchhub python version check?
Also, can I ask what's the right way to load the model locally, thanks a lot!
Additional context
Traceback (most recent call last):
File "loitering_main.py", line 373, in
main()
File "loitering_main.py", line 120, in main
detector = torch.hub.load('ultralytics/yolov5', 'yolov5s',force_reload= True)
File "/home/psl/.local/lib/python3.6/site-packages/torch/hub.py", line 370, in load
model = _load_local(repo_or_dir, model, *args, **kwargs)
File "/home/psl/.local/lib/python3.6/site-packages/torch/hub.py", line 399, in _load_local
model = entry(*args, **kwargs)
File "/home/psl/.cache/torch/hub/ultralytics_yolov5_master/hubconf.py", line 70, in yolov5s
return _create('yolov5s', pretrained, channels, classes, autoshape, verbose, device)
File "/home/psl/.cache/torch/hub/ultralytics_yolov5_master/hubconf.py", line 34, in _create
exclude=('tensorboard', 'pycocotools', 'thop', 'opencv-python'))
File "/home/psl/.cache/torch/hub/ultralytics_yolov5_master/utils/general.py", line 151, in check_requirements
check_python() # check python version
File "/home/psl/.cache/torch/hub/ultralytics_yolov5_master/utils/general.py", line 144, in check_python
assert result, f'Python {minimum} required by YOLOv5, but Python {current} is currently installed'
AssertionError: Python 3.7.0 required by YOLOv5, but Python 3.6.9 is currently installed
The text was updated successfully, but these errors were encountered: