Skip to content

Commit 585fd90

Browse files
committed
Add weights_only=False to avg_checkpoints, needs to load training state dict
1 parent c9a3dc9 commit 585fd90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

avg_checkpoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def checkpoint_metric(checkpoint_path):
4747
if not checkpoint_path or not os.path.isfile(checkpoint_path):
4848
return {}
4949
print("=> Extracting metric from checkpoint '{}'".format(checkpoint_path))
50-
checkpoint = torch.load(checkpoint_path, map_location='cpu')
50+
checkpoint = torch.load(checkpoint_path, map_location='cpu', weights_only=False)
5151
metric = None
5252
if 'metric' in checkpoint:
5353
metric = checkpoint['metric']

0 commit comments

Comments
 (0)