Spaces:
Sleeping
Sleeping
Update yolov5/models/experimental.py
Browse files
yolov5/models/experimental.py
CHANGED
|
@@ -83,9 +83,7 @@ def attempt_load(weights, device=None, inplace=True, fuse=True):
|
|
| 83 |
|
| 84 |
model = Ensemble()
|
| 85 |
for w in weights if isinstance(weights, list) else [weights]:
|
| 86 |
-
with torch.serialization.safe_globals([DetectionModel, Sequential]):
|
| 87 |
ckpt = torch.load(attempt_download(w), map_location='cpu', weights_only=False)
|
| 88 |
-
|
| 89 |
ckpt = (ckpt.get('ema') or ckpt['model']).to(device).float() # FP32 model
|
| 90 |
|
| 91 |
# Model compatibility updates
|
|
|
|
| 83 |
|
| 84 |
model = Ensemble()
|
| 85 |
for w in weights if isinstance(weights, list) else [weights]:
|
|
|
|
| 86 |
ckpt = torch.load(attempt_download(w), map_location='cpu', weights_only=False)
|
|
|
|
| 87 |
ckpt = (ckpt.get('ema') or ckpt['model']).to(device).float() # FP32 model
|
| 88 |
|
| 89 |
# Model compatibility updates
|