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

TensorBoard DP/DDP graph fix #3325

Merged
merged 1 commit into from
May 25, 2021
Merged

TensorBoard DP/DDP graph fix #3325

merged 1 commit into from
May 25, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented May 25, 2021

Possible fix for #3284.

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhanced model compatibility in train.py for single-GPU environments.

πŸ“Š Key Changes

  • Replaced is_parallel() with a new function de_parallel() in train.py and torch_utils.py.
  • Updated usage in train.py to de-parallelize the model for certain operations.

🎯 Purpose & Impact

  • Simplifies model handling: Ensures a consistent single-GPU model is used for operations like TensorBoard graph addition and model checkpoints, preventing errors in non-parallel environments. πŸ–₯️
  • Better code clarity: The de_parallel function clearly communicates its purpose and makes the codebase more maintainable. ✨
  • User experience: Streamlining the code can help users avoid common pitfalls when moving between parallel and non-parallel training setups. Uses of the model in different parts of the code are less error-prone. πŸ‘₯

@glenn-jocher glenn-jocher linked an issue May 25, 2021 that may be closed by this pull request
@glenn-jocher glenn-jocher self-assigned this May 25, 2021
@glenn-jocher glenn-jocher merged commit aad99b6 into master May 25, 2021
@glenn-jocher glenn-jocher deleted the graph_fix branch May 25, 2021 09:45
Lechtr pushed a commit to Lechtr/yolov5 that referenced this pull request Jul 20, 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.

The train.py script prints tensor then quits
1 participant