mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-24 02:59:07 +08:00
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:
parent
ffb71e5793
commit
15aee49d0a
@ -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()) ||
|
||||
|
Loading…
Reference in New Issue
Block a user