Unverified 提交 2d45de61 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Model `ema` key backward compatibility fix (#6972)

上级 c13d4ce7
......@@ -94,7 +94,7 @@ def attempt_load(weights, map_location=None, inplace=True, fuse=True):
model = Ensemble()
for w in weights if isinstance(weights, list) else [weights]:
ckpt = torch.load(attempt_download(w), map_location=map_location) # load
ckpt = (ckpt['ema'] or ckpt['model']).float() # FP32 model
ckpt = (ckpt.get('ema') or ckpt['model']).float() # FP32 model
model.append(ckpt.fuse().eval() if fuse else ckpt.eval()) # fused or un-fused model in eval mode
# Compatibility updates
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论