-
-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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
Detection with Torch Hub Failing #13519
Comments
👋 Hello @llavkush, thank you for your interest in YOLOv5 🚀! It looks like you're encountering an issue while using YOLOv5 with Torch Hub. As you noted, YOLOv5 indeed requires Python >= 3.8 to function properly, and supporting Python 3.7.8 is outside the recommended environment. If this is a 🐛 Bug Report, please share a minimum reproducible example (MRE) of your code that demonstrates the issue. This will greatly help us to investigate further. In the meantime, here are some helpful resources and recommendations: RequirementsYOLOv5 requires Python>=3.8.0 with all requirements.txt dependencies installed: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install If you're unable to upgrade your Python version, consider running YOLOv5 in one of our verified environments where all dependencies are preinstalled: EnvironmentsYOLOv5 can be run in the following up-to-date verified environments:
Using one of these environments may allow you to bypass the need to modify your local setup. TutorialsFor additional guidance: Let us know if upgrading your environment or utilizing a verified environment resolves your issue. If not, please provide the requested MRE for further debugging. This is an automated response – an Ultralytics engineer will take a closer look and assist you further soon. 😊 |
@llavkush to resolve the Python 3.7 compatibility issue with YOLOv5's walrus operator (
model = torch.hub.load('ultralytics/yolov5:v6.2', 'yolov5s') For details see the YOLOv5 v6.2 release notes. We strongly recommend updating to Python 3.8+ for continued support with modern versions. |
@pderrenger thank you for the solution, this works. |
@llavkush you're welcome! Glad the solution worked for you. For future reference, our YOLOv5 documentation contains detailed version compatibility notes and migration guides if you decide to upgrade Python versions later. Happy coding! 🚀 |
Search before asking
Question
I have ML project on Python 3.7.8, it was working fine, but recently I am getting error when loading model with torch.hub.load
File "C:\Users\Strange/.cache\torch\hub\ultralytics_yolov5_master\models\common.py", line 39, in
from utils.dataloaders import exif_transpose, letterbox
File "C:\Users\Strange/.cache\torch\hub\ultralytics_yolov5_master\utils\dataloaders.py", line 776
if mosaic := self.mosaic and random.random() < hyp["mosaic"]:
I know yolov5 require python > 3.8, but all current dependencies in my project is of 3.7.8, please suggest workaround to work with it
Additional
No response
The text was updated successfully, but these errors were encountered: