glenn-jocher commited on
Commit
41bb70b
·
1 Parent(s): 1531795

update create_pretrained()

Browse files
Files changed (1) hide show
  1. utils/utils.py +1 -3
utils/utils.py CHANGED
@@ -641,9 +641,7 @@ def strip_optimizer(f='weights/best.pt'): # from utils.utils import *; strip_op
641
 
642
  def create_pretrained(f='weights/best.pt', s='weights/pretrained.pt'): # from utils.utils import *; create_pretrained()
643
  # create pretrained checkpoint 's' from 'f' (create_pretrained(x, x) for x in glob.glob('./*.pt'))
644
- device = torch.device('cpu')
645
- x = torch.load(s, map_location=device)
646
-
647
  x['optimizer'] = None
648
  x['training_results'] = None
649
  x['epoch'] = -1
 
641
 
642
  def create_pretrained(f='weights/best.pt', s='weights/pretrained.pt'): # from utils.utils import *; create_pretrained()
643
  # create pretrained checkpoint 's' from 'f' (create_pretrained(x, x) for x in glob.glob('./*.pt'))
644
+ x = torch.load(f, map_location=torch.device('cpu'))
 
 
645
  x['optimizer'] = None
646
  x['training_results'] = None
647
  x['epoch'] = -1