init project
Browse files
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(
|