-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
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
Inference on my pretrained model #12419
Comments
@unrue this issue is due to using the |
Thansk Glenn. I tried as suggested, but I get:
I'm on a HPC machine, and compute nodes are not connected to internet. Why Yolo try to download something? The saved model is local. What I have to download? Thanks. |
@unrue If you are not specifying the data that you want to train, it probably is using as default coco datasets and it is trying to download it. Try specifying you data by using --data keyword. |
Ok, I solved:
Not sure if force_reload is necessary, but it works. Thanks. |
@unrue you're welcome! Your solution looks good. The |
@glenn-jocher @unrue |
@goldwater668 Apologies for the confusion. The error you're encountering seems to be related to a file not being found in the specified location. Are you using the latest version of YOLOv5? It's possible that the file |
@glenn-jocher |
@goldwater668 You will need to clone the github repository, if you want to use yolov5 at its full features. Check the documentation below https://docs.ultralytics.com/yolov5/tutorials/train_custom_data/ |
@glenn-jocher |
@glenn-jocher pip install -r https://raw.githubusercontent.com/ultralytics/yolov5/master/requirements.txt If yolov5 is not cloned, an error will be reported. If it is cloned, an error will be reported. |
@goldwater668! 根据你的反馈,我会为你提供一些建议。 首先,请确保安装的是最新版的 YOLOv5。如果你使用了 希望这些信息对你有所帮助。如果你需要更多帮助,欢迎回复我,我会尽力协助你解决问题。 |
@glenn-jocher Name: ultralytics 代码如下: model = torch.hub.load('./runs/train/exp10', 'custom', path='./runs/train/exp10/weights/best.pt', source='local') ` If yolov5 is not cloned, an error will be reported. If it is cloned, an error will be reported. |
@goldwater668 Thanks for providing the version information and the code snippet. It seems your code is attempting to load the custom model from the local directory. If the model is not cloned, you may encounter errors related to module imports. If it is cloned, you may still face issues with the relative paths and module imports. I suggest adhering to the recommended installation process and using the absolute path to load the model. import torch
model = torch.hub.load('ultralytics/yolov5', 'custom', path='absolute/path/to/your/model/best.pt', source='local') Make sure to replace If you continue to experience issues, please let me know and provide the specific error messages for further assistance. |
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help. For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
Search before asking
Question
I successfully trained yolov5x6 model on custom dataset using Yolov5 and Pytorch 1.13. Now, I want to make inference on new images:
Having the following error:
I don't understand, which is the right way to load a pretrained model and make inference? Thanks.
Additional
No response
The text was updated successfully, but these errors were encountered: