From 1475a963939dd5848c0d2134235c62e5876196bf Mon Sep 17 00:00:00 2001 From: LYP <1691608003@qq.com> Date: Tue, 2 Feb 2021 17:06:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9yolov5=204.0?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/experimental.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/experimental.py b/models/experimental.py index a2908a1..e49b104 100644 --- a/models/experimental.py +++ b/models/experimental.py @@ -134,7 +134,10 @@ def attempt_load(weights, map_location=None): model = Ensemble() for w in weights if isinstance(weights, list) else [weights]: attempt_download(w) - model.append(torch.load(w, map_location=map_location)['model'].float().fuse().eval()) # load FP32 model + try: + model.append(torch.load(w, map_location=map_location)['model'].float().fuse().eval()) # load FP32 model + except Exception: + model.append(torch.load(w, map_location=map_location).float().fuse().eval()) # load FP32 model # Compatibility updates for m in model.modules():