githubharald / CTCWordBeamSearch

Connectionist Temporal Classification (CTC) decoder with dictionary and language model.
https://towardsdatascience.com/b051d28f3d2e
MIT License
557 stars 160 forks source link

Does not compile / pass test correctly #34

Closed Sam-Spencer closed 4 years ago

Sam-Spencer commented 4 years ago

If you create a new issue, please provide the following information:

  1. Which program causes the problem

    • Custom TF operation
    • C++ test program
    • Python prototype
  2. Versions

    • TensorFlow version = 2.1.0
    • Python version = 3.7.7
    • C++ compiler = 11.0.3
    • Operating system = macOS Catalina 10.15.4
  3. Issue

    • Which result/error did you get?

      AttributeError: module 'tensorflow' has no attribute 'Session'

Sam-Spencer commented 4 years ago

Follow up: even dropping back to TensorFlow 1, I get the following when running the test:

tensorflow.python.framework.errors_impl.NotFoundError: dlopen(cpp/proj/TFWordBeamSearch.so, 6): Library not loaded: @rpath/libtensorflow_framework.2.dylib
githubharald commented 4 years ago

Did you compile the C++ test program or the TF custom op? Because your issue report is ambiguous. I guess you want to compile for TF. The "AttributeError: module 'tensorflow' has no attribute 'Session'" is due to TF 2, which I do not support. The error reported in your second post seems to be some problem with TF in combination with Mac!? I don't have a Mac to test it, so I can't figure out what the problem is. However, when you search for the text "Library not loaded: @rpath/libtensorflow_framework.2.dylib" in Google you get a lot of hints how other people fixed it.

At some point I will add a Python/Numpy interface to the C++ code to get rid of all those TensorFlow dependencies. But I don't know when I will have the time to do this.

githubharald commented 4 years ago

closed because of inactivity.

taran21 commented 4 years ago

Hi Harald,

I am unable to compile TFWordBeamSearch.so on MacOS Catalina 10.15.2. Getting error as below:

ld: library not found for -l:libtensorflow_framework.1.dylib clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any idea what could be wrong here. I tried adding additional MacOS flag -undefined dynamic_lookup in the g++ command that prepares the .so file. Please help.

I tried setting LIBRARY_PATH, CPPFLAGS, LDFLAGS, LD_LIBRARY_PATH but no luck yet. Anticipating best answer from your side. Thanks and have a good day. Stay safe.