Skip to content

Commit

Permalink
Merge pull request #3251 from stweil/master
Browse files Browse the repository at this point in the history
Show names of failing lstmf files in error messages
  • Loading branch information
egorpugin authored Jan 20, 2021
2 parents c38536f + 5d44a82 commit e285261
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions src/training/unicharset/lstmtrainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e285261

Please sign in to comment.