Merge pull request #3251 from stweil/master

Show names of failing lstmf files in error messages
This commit is contained in:
Egor Pugin 2021-01-20 16:37:37 +03:00 committed by GitHub
commit e2852618fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View File

@ -12,7 +12,7 @@ SUBDIRS = . tessdata unittest
EXTRA_DIST = README.md LICENSE
EXTRA_DIST += aclocal.m4 config configure.ac autogen.sh
EXTRA_DIST += tesseract.pc.in java doc
EXTRA_DIST += CMakeLists.txt tesseract.pc.cmake cmake VERSION src/vs2010
EXTRA_DIST += CMakeLists.txt tesseract.pc.cmake cmake VERSION
DIST_SUBDIRS = $(SUBDIRS)

View File

@ -899,7 +899,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = ../src/vs2010
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded

View File

@ -813,19 +813,22 @@ Trainability LSTMTrainer::PrepareForBackward(const ImageData* trainingdata,
bool invert = trainingdata->boxes().empty();
if (!RecognizeLine(*trainingdata, invert, debug, invert, upside_down,
&image_scale, &inputs, fwd_outputs)) {
tprintf("Image not trainable\n");
tprintf("Image %s not trainable\n",
trainingdata->imagefilename().c_str());
return UNENCODABLE;
}
targets->Resize(*fwd_outputs, network_->NumOutputs());
LossType loss_type = OutputLossType();
if (loss_type == LT_SOFTMAX) {
if (!ComputeTextTargets(*fwd_outputs, truth_labels, targets)) {
tprintf("Compute simple targets failed!\n");
tprintf("Compute simple targets failed for %s!\n",
trainingdata->imagefilename().c_str());
return UNENCODABLE;
}
} else if (loss_type == LT_CTC) {
if (!ComputeCTCTargets(truth_labels, fwd_outputs, targets)) {
tprintf("Compute CTC targets failed!\n");
tprintf("Compute CTC targets failed for %s!\n",
trainingdata->imagefilename().c_str());
return UNENCODABLE;
}
} else {