huazizai commited on
Commit
f166e4a
·
verified ·
1 Parent(s): 590895b

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +1 -1
utils.py CHANGED
@@ -17,7 +17,7 @@ logger = logging
17
 
18
  def load_checkpoint(checkpoint_path, model, optimizer=None):
19
  assert os.path.isfile(checkpoint_path)
20
- checkpoint_dict = torch.load(checkpoint_path, map_location='cpu')
21
  iteration = checkpoint_dict['iteration']
22
  learning_rate = checkpoint_dict['learning_rate']
23
  if optimizer is not None:
 
17
 
18
  def load_checkpoint(checkpoint_path, model, optimizer=None):
19
  assert os.path.isfile(checkpoint_path)
20
+ checkpoint_dict = torch.load(checkpoint_path, map_location='cpu', weights_only=True)
21
  iteration = checkpoint_dict['iteration']
22
  learning_rate = checkpoint_dict['learning_rate']
23
  if optimizer is not None: