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

Filter PyTorch 1.13 UserWarnings #10166

Merged
merged 4 commits into from
Nov 16, 2022

Conversation

triple-Mu
Copy link
Contributor

@triple-Mu triple-Mu commented Nov 15, 2022

When training a model, I get such warnings.
image
Maybe we should filter pytorch 1.13 warning about torch.distributed._all_gather_base or replace it with torch.distributed.all_gather_into_tensor

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Improved warning management for CUDA availability in PyTorch.

📊 Key Changes

  • Added suppression of general UserWarning category warnings in the torch_utils.py file.

🎯 Purpose & Impact

  • 🛠 Purpose: To reduce user confusion by suppressing non-critical warnings that might not directly affect the user experience or functionality of the software.
  • 🧑‍💻 Impact: Users will encounter a cleaner console output, with fewer distractions from warnings that do not require immediate action, enhancing user experience.

@glenn-jocher
Copy link
Member

@triple-Mu thanks for the PR! Yes we should probably filter this message. I started seeing another message also with DDP just like this user:
#10150

UserWarning: is_namedtuple is deprecated, please use the python checks instead

@glenn-jocher
Copy link
Member

@triple-Mu we don't use torch.distributed._all_gather_base in YOLOv5 directly, I think torch 1.13 is using it internally and causing this warning, and same with is_namedtuple. I guess this PR will resolve both of these warnings simultaneously?

@triple-Mu
Copy link
Contributor Author

@triple-Mu we don't use torch.distributed._all_gather_base in YOLOv5 directly, I think torch 1.13 is using it internally and causing this warning, and same with is_namedtuple. I guess this PR will resolve both of these warnings simultaneously?

It will not only filter torch warning but also other python userwarning.
BTW Logger.warning not affected

@glenn-jocher glenn-jocher changed the title Filter pytorch 1.13 warning Filter PyTorch 1.13 UserWarnings Nov 16, 2022
@glenn-jocher glenn-jocher merged commit 9057510 into ultralytics:master Nov 16, 2022
@glenn-jocher
Copy link
Member

@triple-Mu PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐

@triple-Mu triple-Mu deleted the triplemu/fix-warning branch November 16, 2022 15:19
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.

UserWarning: is_namedtuple is deprecated, please use the python checks instead
2 participants