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

Fix AutoAnchor MPS bug #9188

Merged
merged 1 commit into from
Aug 28, 2022
Merged

Fix AutoAnchor MPS bug #9188

merged 1 commit into from
Aug 28, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Aug 28, 2022

Resolves #8862

Signed-off-by: Glenn Jocher glenn.jocher@ultralytics.com

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improved error handling and data processing in anchor optimization for YOLOv5.

πŸ“Š Key Changes

  • Introduced a TryExcept decorator for cleaner error handling.
  • Adjusted anchor checking to use the new decorator, removing explicit try-except blocks.
  • Changed how small object warnings are output and how relevant data is filtered.
  • Ensured consistent data type (float32) for anchor processing results.

🎯 Purpose & Impact

  • πŸš€ Enhanced Readability: Refactoring for better error management makes the code more readable and maintainable.
  • πŸ› οΈ Robustness: Errors during anchor checking will now be handled more gracefully, reducing potential crashes or hangs.
  • πŸŽ›οΈ Data Consistency: Data type standardization helps prevent type mismatch errors and ensures reliable performance across different systems.
  • 🚨 Clear Warnings: Users will get clearer information about potential issues with their data, specifically extremely small objects which might affect model accuracy.

Resolves #8862

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher glenn-jocher self-assigned this Aug 28, 2022
@glenn-jocher glenn-jocher merged commit 1353040 into master Aug 28, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-2 branch August 28, 2022 23:51
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
Resolves ultralytics#8862

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
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.

How can I convert a MPS tensor to float32 for yolov5?
1 participant