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

zero-mAP fix 3 #9058

Merged
merged 4 commits into from
Aug 21, 2022
Merged

zero-mAP fix 3 #9058

merged 4 commits into from
Aug 21, 2022

Conversation

glenn-jocher
Copy link
Member

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

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

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improvement in EMA update mechanism within the YOLOv5 model utility functions.

πŸ“Š Key Changes

  • Removed the @smart_inference_mode() decorator from the EMA update function.
  • Modified the assert statement in EMA update to ensure the data types of the model and EMA weights are both in FP32 after detaching the model state dict.

🎯 Purpose & Impact

  • πŸ› οΈ The removal of @smart_inference_mode() likely aims to improve code simplicity and reduce potential issues with context management that might have occurred.
  • 🧐 Adjusting the assertion for FP32 consistency helps to enforce that EMA updates are processed in a standard floating-point format, ensuring compatibility and consistency in calculations.
  • βœ… These changes can lead to a more robust EMA update process, potentially improving the model's performance and reliability for the end-users.

Note: EMA stands for Exponential Moving Average, which is a technique to update model weights to stabilize training. FP32 refers to 32-bit floating-point data type.

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher glenn-jocher self-assigned this Aug 21, 2022
glenn-jocher and others added 3 commits August 21, 2022 03:19
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher glenn-jocher merged commit 27fb6fd into master Aug 21, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-1 branch August 21, 2022 01:22
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* zero-mAP fix 3

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

* Update torch_utils.py

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

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update torch_utils.py

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.

None yet

1 participant