Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSTMTrainer: Catch empty vectors #978

Merged
merged 1 commit into from
Jun 12, 2017
Merged

Conversation

stweil
Copy link
Member

@stweil stweil commented Jun 4, 2017

The new test in LSTMTrainer::UpdateErrorGraph fixes an assertion
(see issues #644, #792).

The new test in LSTMTrainer::ReadTrainingDump was added to improve
the robustness of the code.

Signed-off-by: Stefan Weil [email protected]

The new test in LSTMTrainer::UpdateErrorGraph fixes an assertion
(see issues tesseract-ocr#644, tesseract-ocr#792).

The new test in LSTMTrainer::ReadTrainingDump was added to improve
the robustness of the code.

Signed-off-by: Stefan Weil <[email protected]>
@Shreeshrii
Copy link
Collaborator

I am still getting the error as this is not merged yet.

Breakpoint 7, tesseract::LSTMTrainer::ReadSizedTrainingDump (this=this@entry=0x7f2a7cb9f680, data=0x0, size=0) at lstmtrainer.cpp:924
924     bool LSTMTrainer::ReadSizedTrainingDump(const char* data, int size) {
(gdb) backtrace
#0  tesseract::LSTMTrainer::ReadSizedTrainingDump (this=this@entry=0x7f2a7cb9f680, data=0x0, size=0) at lstmtrainer.cpp:924
#1  0x0000000000428cc1 in tesseract::LSTMTrainer::ReadTrainingDump (this=this@entry=0x7f2a7cb9f680, data=..., trainer=trainer@entry=0x7f2a7cb9f680)
    at lstmtrainer.cpp:921
#2  0x000000000040af96 in tesseract::LSTMTester::RunEvalSync (this=this@entry=0x7fffe865b310, iteration=1, training_errors=<optimized out>, model_data=...,
    training_stage=1) at lstmtester.cpp:86
#3  0x000000000040b476 in tesseract::LSTMTester::ThreadFunc (lstmtester_void=0x7fffe865b310) at lstmtester.cpp:123
#4  0x00007f2a82be8184 in start_thread (arg=0x7f2a7cba0700) at pthread_create.c:312
#5  0x00007f2a820ca37d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) info frame
Stack level 0, frame at 0x7f2a7cb9f540:
 rip = 0x428c40 in tesseract::LSTMTrainer::ReadSizedTrainingDump (lstmtrainer.cpp:924); saved rip = 0x428cc1
 called by frame at 0x7f2a7cb9f540
 source language c++.
 Arglist at 0x7f2a7cb9f530, args: this=this@entry=0x7f2a7cb9f680, data=0x0, size=0
 Locals at 0x7f2a7cb9f530, Previous frame's sp is 0x7f2a7cb9f538
(gdb) up
#1  0x0000000000428cc1 in tesseract::LSTMTrainer::ReadTrainingDump (this=this@entry=0x7f2a7cb9f680, data=..., trainer=trainer@entry=0x7f2a7cb9f680)
    at lstmtrainer.cpp:921
921       return trainer->ReadSizedTrainingDump(&data[0], data.size());
(gdb) info frame
Stack level 1, frame at 0x7f2a7cb9f540:
 rip = 0x428cc1 in tesseract::LSTMTrainer::ReadTrainingDump (lstmtrainer.cpp:921); saved rip = 0x40b476
 tail call frame, caller of frame at 0x7f2a7cb9f540
 source language c++.
 Arglist at unknown address.
 Locals at unknown address, Previous frame's sp is 0x7f2a7cb9f540
(gdb) up
#2  0x000000000040af96 in tesseract::LSTMTester::RunEvalSync (this=this@entry=0x7fffe865b310, iteration=1, training_errors=<optimized out>, model_data=...,
    training_stage=1) at lstmtester.cpp:86
86        if (!trainer.ReadTrainingDump(model_data, &trainer)) {
(gdb) info frame
Stack level 2, frame at 0x7f2a7cb9feb0:
 rip = 0x40af96 in tesseract::LSTMTester::RunEvalSync (lstmtester.cpp:86); saved rip = 0x40b476
 called by frame at 0x7f2a7cb9fee0, caller of frame at 0x7f2a7cb9f540
 source language c++.
 Arglist at 0x7f2a7cb9f538, args: this=this@entry=0x7fffe865b310, iteration=1, training_errors=<optimized out>, model_data=..., training_stage=1
 Locals at 0x7f2a7cb9f538, Previous frame's sp is 0x7f2a7cb9feb0
 Saved registers:
  rbx at 0x7f2a7cb9fe78, rbp at 0x7f2a7cb9fe80, r12 at 0x7f2a7cb9fe88, r13 at 0x7f2a7cb9fe90, r14 at 0x7f2a7cb9fe98, r15 at 0x7f2a7cb9fea0, rip at 0x7f2a7cb9fea8
(gdb)

@stweil
Copy link
Member Author

stweil commented Jun 12, 2017

@zdenop, please merge before more people get this assertion.

@zdenop zdenop merged commit 2b854e3 into tesseract-ocr:master Jun 12, 2017
@stweil stweil deleted the lstm branch June 12, 2017 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants