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

Detection() device bug fix #1455

Merged
merged 1 commit into from
Nov 19, 2020
Merged

Detection() device bug fix #1455

merged 1 commit into from
Nov 19, 2020

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Nov 19, 2020

This PR fixes a CUDA device bug with PyTorch autoshape models with Detection() outputs.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhancement in tensor device handling for bounding box normalization.

📊 Key Changes

  • Device information is now explicitly assigned to normalization gains tensors.
  • torch.Tensor replaced with torch.tensor to leverage the device argument.

🎯 Purpose & Impact

  • 🛠️ Purpose: To ensure that tensors used for bounding box normalization are created on the same device as the predictions to avoid device mismatch errors.
  • 💻 Impact: Provides a more reliable and consistent tensor handling process, particularly when working with models across different devices. This can lead to smoother model deployments and less troubleshooting for developers and users.
  • ⚡️ User Experience: Improved performance when processing images across CPU and GPU, with reduced risk of encountering device-related bugs.

@glenn-jocher glenn-jocher linked an issue Nov 19, 2020 that may be closed by this pull request
@glenn-jocher glenn-jocher merged commit 199c9c7 into master Nov 19, 2020
@glenn-jocher glenn-jocher deleted the hub_fix branch November 19, 2020 12:45
burglarhobbit pushed a commit to burglarhobbit/yolov5 that referenced this pull request Jan 1, 2021
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
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.

RuntimeError when try load model to CUDA device
1 participant