mirror of
https://github.com/ruvnet/RuView
synced 2026-08-07 20:01:43 +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:
@@ -441,7 +441,7 @@ class WiFiDensePoseTrainer:
|
|||||||
}, path)
|
}, path)
|
||||||
|
|
||||||
def load_model(self, 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.model.load_state_dict(checkpoint['model_state_dict'])
|
||||||
self.optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
|
self.optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user