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

Checkpointer load should specify weights_only #154

Open
baldassarreFe opened this issue Dec 25, 2024 · 0 comments
Open

Checkpointer load should specify weights_only #154

baldassarreFe opened this issue Dec 25, 2024 · 0 comments

Comments

@baldassarreFe
Copy link

From pytorch 2.6 (next release), ``torch.loadwill switch the default forweights_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`:

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.

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

1 participant