EMA bug fix #279

This commit is contained in:
Glenn Jocher committed 2020-07-03 11:56:14 -07:00
1 parent a9d20eba3e
commit df224a0d8f
2 files changed
+11 -14

No files matched your search

+2 -2
View File
@@ -294,7 +294,7 @@ def train(hyp):
batch_size=batch_size,
imgsz=imgsz_test,
save_json=final_epoch and opt.data.endswith(os.sep + 'coco.yaml'),
model=ema.ema.module if hasattr(model, 'module') else ema.ema,
model=ema.ema,
single_cls=opt.single_cls,
dataloader=testloader)
@@ -324,7 +324,7 @@ def train(hyp):
ckpt = {'epoch': epoch,
'best_fitness': best_fitness,
'training_results': f.read(),
'model': ema.ema.module if hasattr(model, 'module') else ema.ema,
'model': ema.ema,
'optimizer': None if final_epoch else optimizer.state_dict()}
# Save last, best and delete