Does not compile / pass test correctly
Sam-Spencer opened this issue · comments
If you create a new issue, please provide the following information:
- Which program causes the problem
- Custom TF operation
- C++ test program
- Python prototype
- Versions
- TensorFlow version = 2.1.0
- Python version = 3.7.7
- C++ compiler = 11.0.3
- Operating system = macOS Catalina 10.15.4
- Issue
-
Which result/error did you get?
AttributeError: module 'tensorflow' has no attribute 'Session'
-
If you think the result is wrong - what result did you expect instead?
Mini example: Label string: [1 0 3] Char string: "ba" # ... remainder of example omitted...
-
How to reproduce the issue?
Just follow the setup documentation with the latest versions of TensorFlow, Python, and Pip. It doesn't work.
-
Provide all necessary data, at least these files: chars.txt, wordChars.txt, corpus.txt, gt_X.txt, mat_X.csv
N/A
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
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.
closed because of inactivity.
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.