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

Tesseract Locks Up when Multiple Programs Attempt to Process #984

Closed
ryan-cahill opened this issue Jun 7, 2017 · 7 comments
Closed

Tesseract Locks Up when Multiple Programs Attempt to Process #984

ryan-cahill opened this issue Jun 7, 2017 · 7 comments

Comments

@ryan-cahill
Copy link

@ryan-cahill ryan-cahill commented Jun 7, 2017

Environment

Version: 4.00.00alpha, from here
uname -a output: Linux T1 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Current Behavior:

Running two or more programs which all attempt to process images with Tesseract seems to lock up all programs indefinitely.

Expected Behavior:

Running two or more programs involving Tesseract would not block all programs from executing.

Suggested Fix:

I don't actually know enough about the codebase itself to to suggest a fix, but would be interested in more information or a workaround.

@Shreeshrii

This comment has been minimized.

Copy link
Contributor

@Shreeshrii Shreeshrii commented Jun 8, 2017

See #961

What is the hardware you are using?
Is this being run under WSL?

I saw improvement by disabling openmp, you can gI've it a try.

@Shreeshrii

This comment has been minimized.

Copy link
Contributor

@Shreeshrii Shreeshrii commented Jun 8, 2017

Try using the latest code from github instead of the initial alpha, there have been many changes and bug fixes.

@ryan-cahill

This comment has been minimized.

Copy link
Author

@ryan-cahill ryan-cahill commented Jun 8, 2017

This actually has nothing to do with training though, just evaluation with the LSTM. I'm running on an Ubuntu 16 VM which has 16GB RAM from the host and 4 cores, so I doubt it has anything to do with the hardware. I'll try the latest code and see what happens

@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Jun 8, 2017

The problems which we observed with training also exist for the tesseract ocr process. It uses multithreading causing a significant overhead for thread synchronisation. Your 4 cores will be sufficient for a single tesseract process, but if you run more than one, the effects which you have seen are not surprising.

Disabling OpenMP and the related multithreading would help for your case. Use configure --disable-openmp. Then I expect that you will be able to run up to four tesseract processes simultaneously.

@ryan-cahill

This comment has been minimized.

Copy link
Author

@ryan-cahill ryan-cahill commented Jun 8, 2017

Thanks @stweil and @Shreeshrii. Will disabling OpenMP affect processing time in a negative way though? For example, if I'm only running one process using Tesseract, will it run more slowly with OpenMP disabled? It sounds like there must be some kind of tradeoff here

@stweil

This comment has been minimized.

Copy link
Contributor

@stweil stweil commented Jun 8, 2017

Yes, for a single process disabling OpenMP will increase the run time – not by a factor 4, but maybe 2. You'll have to try it yourself.

@ryan-cahill

This comment has been minimized.

Copy link
Author

@ryan-cahill ryan-cahill commented Jun 8, 2017

Great, I'll give that a shot and see what happens. Thanks again for the support, closing now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.