Skip to content

Commit

Permalink
Merge pull request tesseract-ocr#1493 from stweil/train
Browse files Browse the repository at this point in the history
lstmtraining: Fix handling of --max_iterations
  • Loading branch information
egorpugin authored Apr 19, 2018
2 parents 36d6cb3 + f95041f commit a474fd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion training/lstmtraining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ int main(int argc, char **argv) {
// Train a few.
int iteration = trainer.training_iteration();
for (int target_iteration = iteration + kNumPagesPerBatch;
iteration < target_iteration;
iteration < target_iteration &&
(iteration < FLAGS_max_iterations || FLAGS_max_iterations == 0);
iteration = trainer.training_iteration()) {
trainer.TrainOnLine(&trainer, false);
}
Expand Down

0 comments on commit a474fd0

Please sign in to comment.