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

AMP check improvements backup YOLOv5n pretrained #7959

Merged
merged 3 commits into from
May 24, 2022
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented May 24, 2022

More robust and faster, removes tolerance parameter.

EDIT: will not work for non-pretrained models...

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhanced PyTorch Automatic Mixed Precision (AMP) testing for accuracy and compatibility.

πŸ“Š Key Changes

  • πŸ” Improved AMP testing with a new helper function amp_allclose for more robust comparison.
  • πŸ–ΌοΈ Added compatibility for checking AMP using a local image or a fallback to an online image if the local one isn't available.
  • βœ… Introduced DetectMultiBackend into the AMP checking process to support more model types.
  • βœ‚οΈ Removed unnecessary CPU device check resulting in more streamlined code.
  • πŸ› οΈ Wrapped the AMP testing code in try-except block to handle exceptions better and provide help via URL if needed.

🎯 Purpose & Impact

  • πŸš€ The modifications enable better verification of the AMP functionality, ensuring that models deliver consistent results when using mixed precision, which can speed up inference without significant loss of accuracy.
  • πŸ’» By automatically falling back to an online image when a local test image is unavailable, users can test AMP functionality in more situations, guaranteeing a smoother user experience.
  • πŸ“ˆ The added support for DetectMultiBackend during AMP validation expands compatibility, which benefits users who work with different types of models, enhancing the utility of YOLOv5 across a wider range of environments.

@glenn-jocher glenn-jocher changed the title Reduce AMP check to detections verification AMP check improvements backup YOLOv5n pretrained May 24, 2022
@glenn-jocher glenn-jocher merged commit d07f9ce into master May 24, 2022
@glenn-jocher glenn-jocher deleted the update/amp branch May 24, 2022 13:33
tdhooghe pushed a commit to tdhooghe/yolov5 that referenced this pull request Jun 10, 2022
* Reduce AMP check to detections verification

More robust and faster

* Update general.py

* Update general.py
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Reduce AMP check to detections verification

More robust and faster

* Update general.py

* Update general.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant