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 final fix: Revert "torch.empty() for speed improvements" #9067

Closed
wants to merge 1 commit into from

Conversation

glenn-jocher
Copy link
Member

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

Reverts #9025

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Transition from uninitialized to zero-initialized tensors in various components.

πŸ“Š Key Changes

  • Replaced torch.empty with torch.zeros in multiple files to ensure tensors are initialized with zeros.
  • Affected areas include model warmup, forward passes, grid and anchor grid initialization, stride computation, batch profiling, TensorBoard logging, and FLOPs calculation.

🎯 Purpose & Impact

  • πŸš€ Purpose: To avoid potential issues arising from using uninitialized memory by explicitly initializing tensors with zeros.
  • πŸ” Impact: This change ensures consistency and stability during model inference and evaluation, making the system more robust and predictable.
  • πŸ€– For Users: Better reliability and determinism in model outputs, with less chance of erratic behavior due to uninitialized variables.

@glenn-jocher glenn-jocher self-assigned this Aug 21, 2022
@pourmand1376
Copy link
Contributor

I'm testing with colab to see if this one helps ...

@glenn-jocher
Copy link
Member Author

Closing in preference of #9068 which isolates the issue better.

@glenn-jocher glenn-jocher deleted the revert-9025-update/empty branch August 29, 2022 12:42
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

2 participants