-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
repeated warning UserWarning: TypedStorage is deprecated
#97207
Comments
cc @kurtamohler could you fix that? As a temporary workaround, you can silent this warning with regular python warning filter: |
The complication is that the warning message contains the line of code that triggered the warning, with Lines 365 to 372 in 0b094ca
So one option is to remove the Another option is to only emit the warning the first time cc @ezyang |
Yeah, let's just have this warn only once and never again. If you're trying to scrub these, you can comment it out |
Hi! Was this issue already solved? I tried to figure it out based on the PRs, but it seems none of them have been merged / released. Is there any suggested way of silencing it? Thanks! |
@lorinczszabolcs, #97379 has been merged to fix this issue, but it hasn't been included in a new release yet Until it's released, you could use the workaround mentioned here: #97207 (comment) But that will silence all import warnings
warnings.filterwarnings('ignore', category=UserWarning, message='TypedStorage is deprecated') |
Fixes pytorch#97207 Pull Request resolved: pytorch#97379 Approved by: https://github.com/ezyang
Hi there, |
@RodolpheCalvet, it sounds like you're experiencing a crash related to UntypedStorage/TypedStorage. Could you please open a new issue and cc me on it? https://github.com/pytorch/pytorch/issues/new?assignees=&labels=&template=bug-report.yml |
* Only warn once for TypedStorage deprecation (#97379) Fixes #97207 Pull Request resolved: #97379 Approved by: https://github.com/ezyang * Specify file encoding in test_torch.py (#97628) Attempt to fix ``` UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 5260: ordinal not in range(128) ``` in https://github.com/pytorch/pytorch/actions/runs/4522628359/jobs/7965372405 In general, it's a good practice to explicitly specify encoding, as otherwise it depends on environment variable and makes tests failures unpredicatble Pull Request resolved: #97628 Approved by: https://github.com/dagitses, https://github.com/kit1980 --------- Co-authored-by: Nikita Shulga <nshulga@meta.com>
馃悰 Describe the bug
I noticed that the warning
UserWarning: TypedStorage is deprecated
that results from callingTensor.storage()
is issued repeatedly, even though the documentation abouttorch.set_warn_always
says that by default pytorch warnings should only be issued once per process. While modifying my code to calluntyped_storage()
instead ofstorage()
could get rid of the excessive warnings, I would prefer not to since I want to keep my code compatible with pre-2.0.0 versions for now, anduntyped_storage()
is only available >=2.0.0.Example:
Output:
Versions
cc @albanD
The text was updated successfully, but these errors were encountered: