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

Swap unsafe_chunk() for chunk() #7362

Merged
merged 1 commit into from
Apr 10, 2022
Merged

Swap unsafe_chunk() for chunk() #7362

merged 1 commit into from
Apr 10, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Apr 10, 2022

Eliminates all unsafe function in YOLOv5 out of an abundance of caution.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Improved safety in anchor chunking during target building in YOLOv5 loss calculation.

📊 Key Changes

  • Replaced unsafe_chunk with chunk in the build_targets method within utils/loss.py.

🎯 Purpose & Impact

  • 🛡️ Enhanced Safety: The change from unsafe_chunk to chunk avoids potential out-of-bounds memory access, which can lead to undefined behavior.
  • Reliability: Ensures the target-building process in loss computation is more reliable across various environments and input data scenarios.
  • 🚀 User Trust: Users can trust that their models are trained with robust and error-resistant code, likely reducing bugs and training issues.

Eliminates all unsafe function in YOLOv5 out of an abundance of caution.
@glenn-jocher glenn-jocher self-assigned this Apr 10, 2022
@glenn-jocher
Copy link
Member Author

Also removes named argument for slight speed improvements.

@glenn-jocher glenn-jocher merged commit 1993efd into master Apr 10, 2022
@glenn-jocher glenn-jocher deleted the update/unsafe branch April 10, 2022 11:53
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
Eliminates all unsafe function in YOLOv5 out of an abundance of caution.
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