-
Notifications
You must be signed in to change notification settings - Fork 238
Open
Description
From pytorch 2.6 (next release), torch.load will switch the default for weights_only from False to True. I was training models using 2.5 (which defaults to weights_only=True) and when I switched to 2.6 I got an exception when resuming a checkpoint because fvcore doesn't pass that parameter and the the default is now False:
fvcore/fvcore/common/checkpoint.py
Line 254 in a491d5b
| return torch.load(cast(IO[bytes], file), map_location=torch.device("cpu")) |
I think Checkpointer should allow passing a value for weights_only, either in the constructor or in Checkpointer.load().
It's a trivial modification to the code, but it's worth discussing where to introduce the new parameter before proposing a PR.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels