Skip to content

Commit 494bcb6

Browse files
Fix a potential bug
1 parent 7a24a82 commit 494bcb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchdistill/common/main_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def load_ckpt(ckpt_file_path, model=None, optimizer=None, lr_scheduler=None, str
306306
:rtype: (float or None, argparse.Namespace or None)
307307
"""
308308
if check_if_exists(ckpt_file_path):
309-
ckpt = torch.load(ckpt_file_path, map_location='cpu')
309+
ckpt = torch.load(ckpt_file_path, weights_only=False, map_location='cpu')
310310
elif isinstance(ckpt_file_path, str) and \
311311
(ckpt_file_path.startswith('https://') or ckpt_file_path.startswith('http://')):
312312
ckpt = torch.hub.load_state_dict_from_url(ckpt_file_path, map_location='cpu', progress=True)

0 commit comments

Comments
 (0)