EMA bug fix 2 (#2330)

* EMA bug fix 2

* update
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-03-01 17:13:34 -08:00
1 parent fd96810518
commit fab5085674
4 files changed
+13 -10

No files matched your search

+2 -1
View File
@@ -115,7 +115,8 @@ 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
ckpt = torch.load(w, map_location=map_location) # load
model.append(ckpt['ema' if ckpt.get('ema') else 'model'].float().fuse().eval()) # FP32 model
# Compatibility updates
for m in model.modules():