githubharald / CTCWordBeamSearch

Connectionist Temporal Classification (CTC) decoder with dictionary and language model.

Home Page:https://harald-scheidl.medium.com/b051d28f3d2e

Repository from Github https://github.comgithubharald/CTCWordBeamSearchRepository from Github https://github.comgithubharald/CTCWordBeamSearch

Unable to create TFWordBeamSearch.so file in windows

sai36 opened this issue · comments

Error while running the buildTF.sh file in windows using git bash.
Error message:

../src/TFWordBeamSearch.cpp:1:10: fatal error: tensorflow/core/framework/op.h: No such file or directory
#include <tensorflow/core/framework/op.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

g++ version:
g++ (MinGW.org GCC-8.2.0-3) 8.2.0

Operating System: Windows 10.

Searched in the system for the header file and it was present.
Included the path in the environmental variables but the error persists.

TensorFlow does not support custom operations on Windows.

Hi Harald,

Thank you for providing such a good code. Unfortunately, I have the same problem. I tried to locate TFWordBeamSearch.so. I couldn't find it! Could you please upload TFWordBeamSearch.so?

I'm using ubuntu. Please look at the problem:

Traceback (most recent call last):
File "main.py", line 297, in
main()
File "main.py", line 247, in main
model = Model(open(FilePaths.fnCharList).read(), decoderType, mustRestore=True)
File "/home/berit/IAM/Model.py", line 39, in init
self.setupCTC()
File "/home/berit/IAM/Model.py", line 122, in setupCTC
word_beam_search_module = tf.load_op_library('TFWordBeamSearch.so')
File "/home/berit/.conda/envs/tf/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py", line 60, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: TFWordBeamSearch.so: cannot open shared object file: No such file or directory

you have to compile it yourself.

Thank you for your prompt reply.
How I can compile it?

Everything is explained in the README.

sir i am still can not compile TFWordBeamSearch.so
can you please elaborate for me clearly

Sir I've the same issue in my Final year prject of my Graduation i.e wordbeamsearch.so not found kindly help in this regard

There is now the possibility to use word beam search in Windows too:
Instead of compiling into a TensorFlow operation, compile into a Python package instead, which uses NumPy arrays as input.
See this section in the README.

SimpleHTR now uses the Python package instead of the TF operation, so SimpleHTR + word beam search can now also be used on Windows 👍 .