从源代码构建 Tensorflow 服务时出错



我正在构建Tensorflow服务,来自适合我的CPU的源代码。我正在使用发布分支 1.14 和 Bazel 版本 0.26.1。 我使用以下命令来构建它:

tools/run_in_docker.sh bazel build --copt=-mavx2 --copt=-mfma --local_resources=2048,.5,1.0 tensorflow_serving/...

我正在使用带有8GB RAM的MacOS Mojave。 错误:

/Users/user/PycharmProjects/serving/.cache/_bazel_user/28517966d062a7dca9cfa7e5166bc7fc/external/org_tensorflow/tensorflow/core/kernels/BUILD:5341:1: C++ compilation of rule '@org_tensorflow//tensorflow/core/kernels:training_ops' failed (Exit 4)
gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
INFO: Elapsed time: 1399.895s, Critical Path: 100.48s
INFO: 101 processes: 101 local.
FAILED: Build did NOT complete successfully

我为此苦苦挣扎了很长一段时间。这方面的任何帮助都会有所帮助。

我使用了以下Tutotial

为了社区的利益,在此处指定解决方案(在答案部分(,即使它存在于评论部分。

通过将 Docker 引擎分配的 RAM 量从 2 GB 增加到 4 GB 可以解决此问题。

相关内容

最新更新