Comments (5)
@Rich2020 hello,
Thank you for reaching out and for providing detailed information about your issue. It looks like you're trying to evaluate your custom model using the torch.hub
interface, but encountering an error due to the absence of the val
method in the AutoShape
class.
To evaluate your custom model, you should load it without the AutoShape
wrapper, which is primarily used for inference. Here's how you can do it:
-
Load the model for evaluation:
import torch # Load your custom model without AutoShape model = torch.hub.load('ultralytics/yolov5', 'custom', path='path/to/best.pt', autoshape=False)
-
Evaluate the model:
You can then use themodel.val
method to evaluate your model on your custom dataset. Ensure that your dataset configuration file (data/config.yml
) is correctly set up.results = model.val(data='data/config.yml', conf=0.25, iou=0.45, save_json=True, save_conf=True)
If you encounter any issues, please ensure you are using the latest versions of torch
and the YOLOv5 repository. You can update them using:
pip install --upgrade torch
pip install --upgrade git+https://github.com/ultralytics/yolov5.git
If the problem persists, please provide a minimum reproducible code example so we can investigate further. You can find more details on creating a minimum reproducible example here.
Thank you for your cooperation, and feel free to reach out if you have any further questions! 😊
from yolov5.
@glenn-jocher Thank you so much. You always respond so quickly and with such helpful answers. I really appreciate all that you do for the world of CV. autoshape=False
was indeed the issue I was facing.
from yolov5.
Hello @Rich2020,
Thank you for your kind words! The credit truly goes to the amazing YOLO community and the dedicated Ultralytics team. I'm glad to hear that setting autoshape=False
resolved your issue.
If you have any more questions or run into any other issues, feel free to reach out. We're here to help! 😊
Best of luck with your project, and happy coding!
Warm
from yolov5.
ABGJE-F32IJ-KL892O-P870T-UVW9Y
from yolov5.
Hello @fsafsfda-KL892O-P870T-UVW9Y,
Thank you for reaching out and for your detailed report. To assist you effectively, we need a minimum reproducible code example. This helps us understand the context and reproduce the issue on our end. You can find guidelines on how to create one here.
Additionally, please ensure you are using the latest versions of torch
and the YOLOv5 repository. You can update them with the following commands:
pip install --upgrade torch
pip install --upgrade git+https://github.com/ultralytics/yolov5.git
Once you've done that, if the issue persists, please share the reproducible code example so we can investigate further.
Thank you for your cooperation, and we look forward to helping you resolve this issue! 😊
from yolov5.
Related Issues (20)
- Hyperparameters explanation HOT 4
- Suppress torch.hub.load() Output HOT 8
- How can I save the detections Yolov5 makes when he's working with a camera source? HOT 4
- How to specify yolov5 to train multiple folders? HOT 1
- pulling out model's layer intermediates HOT 2
- Continuous training of a Ultralytics Model HOT 4
- Exporting trained yolov5 model (trained on custom dataset) to 'saved model' format changes the no. of classes and the name of classes to default coco128 values HOT 2
- more details about training procedure HOT 4
- divide the objects into small and large categories based on the size of the bonding boxes HOT 8
- Request for YOLOv5 v6.2 Source Code under GPL-3.0 License HOT 4
- What prevents me from using the AMP function? HOT 4
- What prevents me from using the AMP function? HOT 1
- What prevents me from using the AMP function? HOT 1
- Background annotation HOT 6
- Hi @7rkMnpl, HOT 2
- Multiple GPU Hyperparameter evolution HOT 5
- Marking YOLOv5 Detection Text Outputs with TP or FP HOT 4
- Multiple threads using yolov5 model concurrent inference failed HOT 4
- Detect head structure differs HOT 4
- runs\train\exp10 is not a directory HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov5.