Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Building TensorFlow Serving example code in Docker container fails with compilation error #590
Building tensorflow_serving/example/... (from https://www.tensorflow.org/serving/serving_inception, Clone, configure, and build TensorFlow Serving in a container) with bazel fails with the following error:
ERROR: /root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/org_tensorflow/tensorflow/core/kernels/BUILD:2537:1: C++ compilation of rule '@org_tensorflow//tensorflow/core/kernels:cwise_op' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 128 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 4.
The compilation error can be addressed by increasing memory available to the docker daemon from 2GB to 6-8GB. This should be documented on https://www.tensorflow.org/serving/serving_inception.
After increasing memory to 8GB, I am now seeing the following errors:
Thanks! It works fine.
Let's add that to the doc....
Now it is failing with
bazel build -c opt tensorflow_serving/example/...
Sorry for all the issues!
The first problem ("internal compiler error: Killed (program cc1plus)") is a compiler error that's not specific to the inception tutorial or Docker, it's just a resource issue. You can increase the resources given to Docker or constrain the resources used by Bazel to compile (this solution was used in other GitHub issues if you search for "cc1plus").
https://www.tensorflow.org/serving/setup mentions "Consult the TensorFlow install instructions if you encounter any issues with setting up TensorFlow or its dependencies." with a link. TF's dependencies change over time so to avoid duplicating the documentation, we just link to it. Autograd for example was only added as a dep in the last couple of weeks, but you can see all deps here.
Your last problem seems to be due to mismatched versions. I would guess you synced to an older version of TF Serving while still keeping a newer TF submodule (or started with an older TF serving and synced the TF submodule to head, which does not work). If you look at the repo at head, we no longer use "@protobuf//" (TF renamed it) and instead now use "@protobuf_archive" which is what TF defined.