hujiecpp commited on
Commit
2c29146
·
1 Parent(s): 4d17f72

init project

Browse files
Files changed (1) hide show
  1. modules/ultralytics/nn/tasks.py +1 -1
modules/ultralytics/nn/tasks.py CHANGED
@@ -515,7 +515,7 @@ def torch_safe_load(weight):
515
  check_suffix(file=weight, suffix='.pt')
516
  file = attempt_download_asset(weight) # search online if missing locally
517
  try:
518
- return torch.load(file, map_location='cpu'), file # load
519
  except ModuleNotFoundError as e: # e.name is missing module name
520
  if e.name == 'models':
521
  raise TypeError(
 
515
  check_suffix(file=weight, suffix='.pt')
516
  file = attempt_download_asset(weight) # search online if missing locally
517
  try:
518
+ return torch.load(file, map_location='cpu', weights_only=False), file # load
519
  except ModuleNotFoundError as e: # e.name is missing module name
520
  if e.name == 'models':
521
  raise TypeError(