-
Notifications
You must be signed in to change notification settings - Fork 896
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
FutureWarning: You are using torch.load
with weights_only=False
#1429
Comments
The error can be suppressed by using the following before calling stanza functions but is not a solution import warnings |
Aware of it. There's a limitation where we are saving plenty of things
other than weights in the current file. Config strings and numbers,
mostly. Would those still work?
…On Tue, Oct 22, 2024, 10:19 PM mskaif ***@***.***> wrote:
The error can be suppressed by using the following before calling stanza
functions but is not a solution
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
source: ultralytics/ultralytics#14994 (comment)
<ultralytics/ultralytics#14994 (comment)>
—
Reply to this email directly, view it on GitHub
<#1429 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2AYWPIB3WEPPBSGN337ALZ44WXBAVCNFSM6AAAAABQN6FUXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZQHEZTAMBQGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
…re in the save files, use weights_only=True. Significantly cuts down on the number of torch warnings. #1429
…re in the save files, use weights_only=True. Significantly cuts down on the number of torch warnings. #1429
Some of the models can be updated to use |
…re in the save files, use weights_only=True. Significantly cuts down on the number of torch warnings. #1429
…re in the save files, use weights_only=True. Significantly cuts down on the number of torch warnings. #1429
sorry for not getting back earlier. I'm using the built-in models like so: affected from the pipeline are: Thank you for the commit! |
…re in the save files, use weights_only=True. Significantly cuts down on the number of torch warnings. #1429
…re in the save files, use weights_only=True. Significantly cuts down on the number of torch warnings. #1429
…re in the save files, use weights_only=True. Significantly cuts down on the number of torch warnings. #1429
…re in the save files, use weights_only=True. Significantly cuts down on the number of torch warnings. #1429
Describe the bug
FutureWarning: You are using
torch.load
withweights_only=False
(the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value forweights_only
will be flipped toTrue
. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user viatorch.serialization.add_safe_globals
. We recommend you start settingweights_only=True
for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.state = torch.load(filename, lambda storage, loc: storage)
This warning is triggered by all torch.load used in stanza. The issue does not cause any problem with data processing at the moment but the long warnings are distracting.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
no error
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: