tensorflow: TF 1.5.0 Java API broken in Ubuntu 14.04: `GLIBCXX_3.4.20' not found
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 14.04
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): 1.5.0
- Python version: N/A
- Bazel version (if compiling from source): N/A
- GCC/Compiler version (if compiling from source): N/A
- CUDA/cuDNN version: N/A
- GPU model and memory: N/A
- Exact command to reproduce: N/A
Describe the problem
The 1.5.0 Java API fails at runtime on Ubuntu 14.04 (after working okay for 1.3/1.4) on the hello world example. I originally noticed this behavior in CentOS 7; I’m reporting this as a bug for Ubuntu 14.04 because it is officially supported in the docs and the error appears to be the same.
Possibly related to #15777, in which case the solution may just be to build libtensorflow_jni.so on Ubuntu 14. Thanks in advance for looking into this!
Source code / logs
- (Optionally) use docker container with Java 8 and Maven:
docker pull goyalzz/ubuntu-java-8-maven-docker-imagedocker run -it goyalzz/ubuntu-java-8-maven-docker-image:latest bash - Follow instructions in official Java API Maven example.
- Upon Step 3 of above (
mvn -q compile exec:java), observe the following error:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project hellotf: An exception occured while executing the Java class. /tmp/tensorflow_native_libraries-1518205710861-0/libtensorflow_jni.so: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /tmp/tensorflow_native_libraries-1518205710861-0/libtensorflow_jni.so) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (7 by maintainers)
1.6.0-rc1 will not support 14.04, but we will try to support it in 1.6.0 official.
I would appreciate it if you would reconsider for the same reasons it was reconsidered in #15777. We are happily using the java API on CentOS 7. This version upgrade to TF effectively means we need to rebuild these artifacts and deploy the associated (non-trivial) build chain.
I have the exact same problem with TF Java 1.5.0 on Red Hat Enterprise Linux 7 and CentOS 7. TF 1.4.0 Java worked fine before.
Unfortunately, this is the newest version of RHEL/CentOS (there is no 8 yet, not even beta).
Python TF 1.5.0 (tensorflow-1.5.0-cp27-cp27mu-manylinux1_x86_64.whl) works just fine on RHEL/CentOS7, so this seems specific to TF Java.
We can try looking into building this with ubuntu 14.04 We can work together on Monday to come up with a solution.
Please see https://github.com/tensorflow/tensorflow/issues/16899#issuecomment-365441309