fix: torch.load 添加 weights_only=False 以兼容新版 PyTorch
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,7 @@ class HairSegmenter:
|
||||
self._torch = torch
|
||||
self.device = _select_device(torch)
|
||||
self.net = BiSeNet(n_classes=N_CLASSES)
|
||||
state = torch.load(weights_path, map_location="cpu")
|
||||
state = torch.load(weights_path, map_location="cpu", weights_only=False)
|
||||
self.net.load_state_dict(state)
|
||||
self.net.to(self.device)
|
||||
self.net.eval()
|
||||
|
||||
Reference in New Issue
Block a user