Skip to content

Commit d3ce5a8

Browse files
Avoid zero division error
1 parent 648aaa4 commit d3ce5a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ def _backward(_loss):
10701070
if utils.is_primary(args):
10711071
_logger.info(
10721072
f'Train: {epoch} [{update_idx:>4d}/{updates_per_epoch} '
1073-
f'({100. * update_idx / (updates_per_epoch - 1):>3.0f}%)] '
1073+
f'({100. * (update_idx + 1) / updates_per_epoch:>3.0f}%)] '
10741074
f'Loss: {losses_m.val:#.3g} ({losses_m.avg:#.3g}) '
10751075
f'Time: {update_time_m.val:.3f}s, {update_sample_count / update_time_m.val:>7.2f}/s '
10761076
f'({update_time_m.avg:.3f}s, {update_sample_count / update_time_m.avg:>7.2f}/s) '

0 commit comments

Comments
 (0)