增加对yolov5 4.0的支持
parent
62a205f741
commit
1475a96393
|
@ -134,7 +134,10 @@ def attempt_load(weights, map_location=None):
|
||||||
model = Ensemble()
|
model = Ensemble()
|
||||||
for w in weights if isinstance(weights, list) else [weights]:
|
for w in weights if isinstance(weights, list) else [weights]:
|
||||||
attempt_download(w)
|
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
|
# Compatibility updates
|
||||||
for m in model.modules():
|
for m in model.modules():
|
||||||
|
|
Loading…
Reference in New Issue