-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
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
No module named 'models' question #131
Comments
Hello @ioir123ju, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook , Docker Image, and Google Cloud Quickstart Guide for example environments. 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 model or data training question, please note that Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:
For more information please visit https://www.ultralytics.com. |
@ioir123ju use a working environment. See https://github.com/ultralytics/yolov5#reproduce-our-environment |
yes, My environment meets your requirements.
And I can run detect.py in your repo. |
@ioir123ju debug your environment, or just use one of our working ones. That's what they are there for. |
I have the same problem, torch 1.6rc2 |
Same problem over here. |
@fpingham you are probably using an older version of the repo, an older model, or are not meeting the minimum dependency requirements. I would start from a clean slate in one of the verified environments below. EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
|
🐛 Bug
When I use yolov5 outside the repo and use "torch.load(the_mode, PATH)", I got the error "No module named 'models'"
I see a solution in #22.
But I got error when I use
model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)
torch.nn.modules.module.ModuleAttributeError: 'BatchNorm2d' object has no attribute '_non_persistent_buffers_set'
So I still want to load model in this way:
model.load_state_dict(torch.load(new_weights))
Can you tell me how to use model.load_state_dict ?
The text was updated successfully, but these errors were encountered: