Coder Social home page Coder Social logo

Comments (5)

glenn-jocher avatar glenn-jocher commented on September 8, 2024 1

@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:

  1. 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)
  2. Evaluate the model:
    You can then use the model.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.

Rich2020 avatar Rich2020 commented on September 8, 2024

@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.

glenn-jocher avatar glenn-jocher commented on September 8, 2024

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.

fsafsfda avatar fsafsfda commented on September 8, 2024

ABGJE-F32IJ-KL892O-P870T-UVW9Y

from yolov5.

glenn-jocher avatar glenn-jocher commented on September 8, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.