-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
PyTorch 2.6 has changed the default value of weights_only
to True
, breaking the loading of some nnunetv2
models
#2681
Comments
I also have this issue. When you install pytorch ( |
I just tried it. If you change to
in |
I created a PR with this fix. |
While setting If Of course there are pros and cons when it comes to maintenance expectations on the |
The following fixes this issue:
just prior to running |
PyTorch 2.6 isn't out on PyPI yet, but it just dropped on the http://download.pytorch.org/whl/cpu/torch/, and so we ran into the following class of error:
Full list of errors (and the relevant globals) below:
In our case, because the call to
torch.load()
occurs withinnnunetv2
, we can't setweights_only=False
(even if we wanted to opt-in to the unsafe behavior).That being said, I wanted to invite a larger discussion about how to make
nnunetv2
models compatible with the new default ofweights_only=True
. I'm not intimately familiar with "safe globals" in PyTorch, or hownnunetv2
does (or does not) use them, so I would love to learn more about hownnunetv2
plans to handle this change.Thanks much!♥️
The text was updated successfully, but these errors were encountered: