Skip to content

zero-mAP final fix: Revert "torch.empty() for speed improvements"#9067

Closed
glenn-jocher wants to merge 1 commit intomasterfrom
revert-9025-update/empty
Closed

zero-mAP final fix: Revert "torch.empty() for speed improvements"#9067
glenn-jocher wants to merge 1 commit intomasterfrom
revert-9025-update/empty

Conversation

@glenn-jocher
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@glenn-jocher
Copy link
Copy Markdown
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.

2 participants