Skip to content

Updated torch.load function#92

Open
Varun-sai-500 wants to merge 1 commit intoyoxu515:mainfrom
Varun-sai-500:fixes
Open

Updated torch.load function#92
Varun-sai-500 wants to merge 1 commit intoyoxu515:mainfrom
Varun-sai-500:fixes

Conversation

@Varun-sai-500
Copy link
Contributor

In pytorch >= 2.6 version, the torch.load function basically refuses to load the pickled ones due to safety reasons
So, I have introduced a parameter inside the function as weights_only = False, with this, the execution is safer, as the .pth file contains not only weights but other things like optimizer and state dicts, so setting weights only to false help the loading of the pickled objects for pytorch newer versions

The older versions (while I was experimenting on jetson device) gave me warnings, now with the pytorch update the warning turned to an error

@Varun-sai-500
Copy link
Contributor Author

@z-x-yang Can you please review it, and review the PRs in the other repository as well, thanks!

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

Successfully merging this pull request may close these issues.

1 participant