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

Fix torch multi-GPU --device error #1701

Merged
merged 2 commits into from
Dec 16, 2020

Conversation

NanoCode012
Copy link
Contributor

@NanoCode012 NanoCode012 commented Dec 16, 2020

Should fix #1695

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improved device handling for profiling utility in YOLOv5.

πŸ“Š Key Changes

  • Changed the default parameter of device from a static assignment to None.
  • Dynamically setting the device inside the profile function if not provided.

🎯 Purpose & Impact

  • πŸ› οΈ Flexibility: This change allows the profile function to be more flexible by not forcing a predefined device, enhancing usability across different hardware.
  • πŸ’» Convenience: Automatically selects the appropriate device (CPU or GPU), simplifying the function call for users.
  • πŸš€ User-Friendly: Potentially reduces errors for users who forget to specify a device, making the function more robust and user-friendly.

@glenn-jocher glenn-jocher changed the title Fix torch GPU error Fix torch multi-GPU --device error Dec 16, 2020
single-line device =
@glenn-jocher
Copy link
Member

@NanoCode012 branch works!! Amazing work tracking this down, excellent job! πŸš€πŸš€πŸš€πŸš€

@NanoCode012
Copy link
Contributor Author

NanoCode012 commented Dec 16, 2020

I ran a full UnitTest on this branch. It passes them.

@glenn-jocher glenn-jocher merged commit 035ac82 into ultralytics:master Dec 16, 2020
burglarhobbit pushed a commit to burglarhobbit/yolov5 that referenced this pull request Jan 1, 2021
* Fix torch GPU error

* Update torch_utils.py

single-line device =

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@NanoCode012 NanoCode012 deleted the gpu-fix branch January 7, 2021 12:45
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
* Fix torch GPU error

* Update torch_utils.py

single-line device =

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Fix torch GPU error

* Update torch_utils.py

single-line device =

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.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.

CUDA multi-GPU --device bug
2 participants