Abort LSTM training with integer model (fixes issue #1573)

Tesseract currently cannot continue LSTM training from an
integer (fast) model.

Report this to users who try it nevertheless instead of crashing
with an assertion.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2021-09-06 08:17:18 +02:00
parent ffb71e5793
commit 15aee49d0a

View File

@ -132,6 +132,10 @@ bool LSTMTrainer::TryLoadingCheckpoint(const char* filename,
if (!(*file_reader_)(filename, &data)) return false;
tprintf("Loaded file %s, unpacking...\n", filename);
if (!checkpoint_reader_->Run(data, this)) return false;
if (IsIntMode()) {
tprintf("Error, %s is an integer (fast) model, cannot continue training\n", filename);
return false;
}
StaticShape shape = network_->OutputShape(network_->InputShape());
if (((old_traineddata == nullptr || *old_traineddata == '\0') &&
network_->NumOutputs() == recoder_.code_range()) ||