Spaces:
Runtime error
Runtime error
myniu
commited on
Commit
·
69de41b
1
Parent(s):
61527a8
loadfunc
Browse files
models/cmp/utils/common_utils.py
CHANGED
@@ -96,7 +96,8 @@ def load_state(path, model, optimizer=None):
|
|
96 |
return storage.cuda()
|
97 |
if os.path.isfile(path):
|
98 |
print("=> loading checkpoint '{}'".format(path))
|
99 |
-
checkpoint = torch.load(path, map_location=map_func)
|
|
|
100 |
model.load_state_dict(checkpoint['state_dict'], strict=False)
|
101 |
ckpt_keys = set(checkpoint['state_dict'].keys())
|
102 |
own_keys = set(model.state_dict().keys())
|
|
|
96 |
return storage.cuda()
|
97 |
if os.path.isfile(path):
|
98 |
print("=> loading checkpoint '{}'".format(path))
|
99 |
+
# checkpoint = torch.load(path, map_location=map_func)
|
100 |
+
checkpoint = torch.load(path)
|
101 |
model.load_state_dict(checkpoint['state_dict'], strict=False)
|
102 |
ckpt_keys = set(checkpoint['state_dict'].keys())
|
103 |
own_keys = set(model.state_dict().keys())
|