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

process_batch() as numpy arrays #8254

Merged
merged 1 commit into from
Jun 18, 2022
Merged

process_batch() as numpy arrays #8254

merged 1 commit into from
Jun 18, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jun 18, 2022

Avoid potential issues with deterministic ops.

  • verify for identical mAP to master

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Updated validation processing to use NumPy for intermediate computations.

πŸ“Š Key Changes

  • Changed the correct tensor creation from a PyTorch tensor to a NumPy array before turning it back into a PyTorch tensor.
  • The intermediate computation for process_batch within val.py now utilizes NumPy for the correct array handling instead of PyTorch.

🎯 Purpose & Impact

  • 🌐 The use of NumPy may optimize certain aspects of the intermediate computation. It's often the case that NumPy is faster for element-wise operations and PyTorch is optimized for batch operations on GPUs.
  • 🧠 Transitioning between NumPy and PyTorch may improve computational efficiency, memory usage, or the speed of the operations within process_batch.
  • πŸ” Users might experience faster validation times during model evaluation without noticeable changes in the workflow or outputs.

Avoid potential issues with deterministic ops. 

[ ] - verify for identical mAP to master
@glenn-jocher glenn-jocher self-assigned this Jun 18, 2022
@glenn-jocher glenn-jocher merged commit 669f707 into master Jun 18, 2022
@glenn-jocher glenn-jocher deleted the update/val branch June 18, 2022 11:54
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
Avoid potential issues with deterministic ops. 

[ ] - verify for identical mAP to master
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