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

Suggestion: use e.g. with warnings.catch_warnings() in favor of module-level warnings suppression #29

Closed
matthewcarbone opened this issue Apr 27, 2021 · 2 comments

Comments

@matthewcarbone
Copy link
Contributor

filterwarnings("ignore", module="torch.nn.functional")

I'd recommend against module-level warnings suppression in favor of

with warnings.catch_warnings():
    warnings.simplefilter('ignore')

at the precise spot where the warnings are thrown.

Thoughts?

@ziatdinovmax
Copy link
Owner

Yes, this would be a more proper way of doing this. I think here we are suppressing the annoying warning about the align_corners from torch.nn.functional.interpolate.

@matthewcarbone
Copy link
Contributor Author

Yeah this is definitely more nitpicky an issue for sure... I have had my experiences with a crazy number of warnings from nn.functional too. If at some point I can pin down exactly where the errors come from (and ensure I don't miss any), I will make this change. For now I'd say this is low priority. After all, it's only suppressing warnings, not errors, which by definition shouldn't really impact the code.

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

No branches or pull requests

2 participants