From 45fb7dde495df31629b7b5ca36b654a6bccfb762 Mon Sep 17 00:00:00 2001 From: rays Date: Sat, 15 Jul 2017 23:36:58 -0700 Subject: [PATCH] Fixed regression of issue #644 again! --- lstm/lstmtrainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lstm/lstmtrainer.cpp b/lstm/lstmtrainer.cpp index 30e04723c5..e9722d642c 100644 --- a/lstm/lstmtrainer.cpp +++ b/lstm/lstmtrainer.cpp @@ -1268,7 +1268,7 @@ STRING LSTMTrainer::UpdateErrorGraph(int iteration, double error_rate, if (error_rate > best_error_rate_ && iteration < best_iteration_ + kErrorGraphInterval) { // Too soon to record a new point. - if (tester != NULL) { + if (tester != NULL && !worst_model_data_.empty()) { mgr_.OverwriteEntry(TESSDATA_LSTM, &worst_model_data_[0], worst_model_data_.size()); return tester->Run(worst_iteration_, NULL, mgr_, CurrentTrainingStage());