-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
Make requirements installation optional #3094
Comments
👋 Hello @tadejsv, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com. RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
@tadejsv hi thanks for the feedback! Yes we are aware of this issue and are looking for a fix, see #3073 for a duplicate issue. Pillow is a requirement for Hub models as it is used throughout our autoshape wrapper. Could you run the commands in #3073 (comment) and report back your results? Thank you! |
Hi @glenn-jocher - I ran the commands from the issue mentioned, both show no package found, even though But I don't think that is a duplicate issue. My issue is not that in this particular case the right package is not picked up, it is that I would prefer that |
@tadejsv Pillow is a hard requirement. You can not run YOLOv5 PyTorch Hub models without it, regardless of your input method. If you're missing it and it is being auto-installed then everything is working as intended. If your opencv installation is not found, then there is a bug and things are not working as intended. I'm confused though, none of the 3 methods in #3073 (comment) detected your |
No, because it is not installed with pip. I am aware that things are "working as intended", that's why I opened this as a feature request and not a bug report :) |
To clarify, the package I have installed is |
@tadejsv you may not want to rely on 3rd party opencv packages, as their reliability is unknown, and also because they will cause conflicts with the requirements.txt dependencies. One workaround if you would like to experiment with alternate packages is to simply fork this repo into your own directory, make any modifications you want to your forked hubconf.py, and then load YOLOv5 Hub models from your fork: import torch
# Model
model = torch.hub.load('your_github_account/yolov5', 'yolov5s') You can comment the Line 18 in d6a71ae
|
@glenn-jocher I've had no issue with reliability so far. I am using the conda installation of opencv as it is compiled with some OpenCV modules which the pip installation does not have. I also prefer using conda as it makes sure all other system dependencies are installed. I am aware I could fork the repo, I was just hoping for a more "elegant" solution that does not involve maintaining my own fork. Anyways, I see that changes to requirements installation here aren't something you are willing to consider, so I'll be closing this issue. |
@tadejsv thanks for the feedback, we'll keep it in mind for future updates. |
@tadejsv good news 😃! Your original issue may now be fixed ✅ in PR #3298. This PR increases robustness to failures in
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 This does not solve my issue, as my issue was not with failures during installation, but rather with unwanted packages being installed |
@tadejsv got it, thanks for the feedback! |
@tadejsv good news 😃! Your original issue may now be fixed ✅ in PR #3495. This PR adds opencv-python to the hubconf.py check_requirements()
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 🚀! |
🚀 Feature
I am using
yolov5
viatorch.hub
. When I load a model, the library attempts to install all the requirements. This is a problem for me, as the installed packages interfere with my system packages. Specifically, I haveopencv
installed via conda, butyolo5
does not see it, and assumes it is missing, so it starts installingopencv-python
. This then messes up some ofopencv
functionality. And in general, some packages that it tries to install are not strictly necessary - you only need PIL if you use it to load images, which I do not.Would it be possible to make this installation optional, and just issue a warning if some packages are not found? This would make my life much easier :)
The text was updated successfully, but these errors were encountered: