glenn-jocher
commited on
Commit
•
18b4da9
1
Parent(s):
c8f0694
PyTorch Hub update
Browse files- hubconf.py +1 -1
hubconf.py
CHANGED
@@ -29,7 +29,7 @@ def create(name, pretrained, channels, classes):
|
|
29 |
ckpt = '%s.pt' % name # checkpoint filename
|
30 |
google_utils.attempt_download(ckpt) # download if not found locally
|
31 |
state_dict = torch.load(ckpt)['model'].state_dict()
|
32 |
-
state_dict = {k: v for k, v in state_dict if model.state_dict()[k].numel() == v.numel()} # filter
|
33 |
model.load_state_dict(state_dict, strict=False) # load
|
34 |
return model
|
35 |
|
|
|
29 |
ckpt = '%s.pt' % name # checkpoint filename
|
30 |
google_utils.attempt_download(ckpt) # download if not found locally
|
31 |
state_dict = torch.load(ckpt)['model'].state_dict()
|
32 |
+
state_dict = {k: v for k, v in state_dict.items() if model.state_dict()[k].numel() == v.numel()} # filter
|
33 |
model.load_state_dict(state_dict, strict=False) # load
|
34 |
return model
|
35 |
|