Fix: number of iterations wasn't set correctly (num_iterations directly set to equal to max_num_iterations) (#3526)

Fix: number of iterations wasn't set correctly

The original code causes iteration to go over max_num_iterations, causing progress tracker be unable to estimate time needed to finish, and causes unwanted extra iterations
This commit is contained in:
Daniel Wang authored and GitHub committed 2024-11-28 11:50:37 -08:00
1 parent 11ca6e379e
commit 4d73c4e61e
1 file changed
+1 -1
+1 -1
View File
@@ -240,7 +240,7 @@ class Trainer:
self._init_viewer_state()
with TimeWriter(writer, EventName.TOTAL_TRAIN_TIME):
num_iterations = self.config.max_num_iterations
num_iterations = self.config.max_num_iterations - self._start_step
step = 0
self.stop_training = False
for step in range(self._start_step, self._start_step + num_iterations):