Skip to content
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

Why do I suddenly need to pip install the ultralytics library to get yolov5 from torch hub? #11544

Closed
1 task done
dtronmans opened this issue May 17, 2023 · 4 comments
Closed
1 task done
Labels
question Further information is requested

Comments

@dtronmans
Copy link

dtronmans commented May 17, 2023

Search before asking

Question

I was always able to load yolov5 and run inference using the following lines:

`import torch

model = torch.hub.load('ultralytics/yolov5', 'custom', path=weights_path)`

and I never needed to run pip install ultralytics in order to run this code. However, since a few days ago suddenly I am no longer able to run this code without having the "ultralytics" library installed, which unfortunately is quite annoying for my code because it requires quite high version numbers for some packages, which I am not able to do because my code relies on some older versions of some libraries. Is this new? Is there anything I could do to run this code with just having torch installed?

EDIT: I now see the following Pull Request: #11529 that was closed 3 days ago, which I think is the source of the problem. This is quite annoying because it also comes with me having to install a new pip package with a lot of different version requirements for different libraries that come with it. Any way to circumvent that?

Additional

No response

@dtronmans dtronmans added the question Further information is requested label May 17, 2023
@github-actions
Copy link
Contributor

👋 Hello @dtronmans, 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 a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Introducing YOLOv8 🚀

We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀!

Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.

Check out our YOLOv8 Docs for details and get started with:

pip install ultralytics

@glenn-jocher
Copy link
Member

@dtronmans hi there,

I'm sorry to hear that you are experiencing some issues with loading YOLOv5 model without installing the "ultralytics" library recently. This is a result of a recent pull request, as you have mentioned in your edit.

Unfortunately, it is now required to have the "ultralytics" library installed to load the YOLOv5 model. The good news is that the installation process is quick and easy.

Regarding the issue of high version numbers for some packages with the "ultralytics" library, I suggest trying to create a virtual environment and install all the required packages and dependencies within the virtual environment to avoid conflict with the current version of your libraries.

Please let us know if you have any other questions or concerns. We are here to help.

@dtronmans
Copy link
Author

Hey @glenn-jocher,

Thank you for the quick answer! I am indeed already installing everything in a virtual environment. However I will try to make the dependencies work with each other by being less strict on the versions for current packages.

Best regards

@glenn-jocher
Copy link
Member

@dtronmans,

You're welcome! I'm glad that I could be of help.

Yes, that sounds like a good plan. If you have any further questions or concerns, please do not hesitate to let us know. We would be happy to assist you.

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants