Skip to content

Commit 9496d17

Browse files
committed
fix bug in final saving
1 parent 2d69459 commit 9496d17

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

train.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,12 @@ def main():
647647
log_suffix='(EMA)',
648648
model_mode=choice))
649649
if args.local_rank == 0:
650+
if args.test_mode:
651+
epoch=0
652+
save_metric=None
650653
saver.save_checkpoint(
651654
model, optimizer, args,
652-
epoch=0, model_ema=model_ema, metric=None, use_amp=use_amp)
655+
epoch=epoch+1, model_ema=model_ema, metric=save_metric, use_amp=use_amp)
653656

654657
if args.local_rank == 0:
655658
print('Test results of the last epoch:\n', eval_metrics)

0 commit comments

Comments
 (0)