mirror of
https://github.com/ruvnet/RuView.git
synced 2026-04-28 05:59:32 +00:00
Merge pull request #133 from ruvnet/fix/pickle-deserialization-safety
fix: safe PyTorch model loading (weights_only=True)
This commit is contained in:
commit
26655d397e
1 changed files with 1 additions and 1 deletions
|
|
@ -441,7 +441,7 @@ class WiFiDensePoseTrainer:
|
|||
}, path)
|
||||
|
||||
def load_model(self, path):
|
||||
checkpoint = torch.load(path)
|
||||
checkpoint = torch.load(path, map_location=self.device, weights_only=True)
|
||||
self.model.load_state_dict(checkpoint['model_state_dict'])
|
||||
self.optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue