bazel build tensorflow/python/tools:strip_未使用的编译失败

bazel build tensorflow/python/tools:strip_未使用的编译失败,tensorflow,bazel,Tensorflow,Bazel,我正在尝试从docker映像中运行此bazel命令 docker run -it gcr.io/tensorflow/tensorflow:latest-devel cd /tensorflow bazel build tensorflow/python/tools:strip_unused 但是,它会因以下错误而失败: ERROR: /tensorflow/tensorflow/core/kernels/BUILD:1970:1: C++ compilation of rule '//te

我正在尝试从docker映像中运行此bazel命令

docker run -it  gcr.io/tensorflow/tensorflow:latest-devel
cd /tensorflow
bazel build tensorflow/python/tools:strip_unused
但是,它会因以下错误而失败:

ERROR: /tensorflow/tensorflow/core/kernels/BUILD:1970:1: C++ compilation of rule '//tensorflow/core/kernels:svd_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 107 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 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-5/README.Bugs> for instructions.
Target //tensorflow/python/tools:strip_unused failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 609.363s, Critical Path: 456.46s
<代码>错误:/TracoFrase/TysFrace/TysFrace/Cyrn/Calng/Bug:规则'//TunSoFrase/Cys/Orn:ScDyOP失败:Grace/Ur/Bi/Gcc-UyFiTrFixOffer-Fuffer-Prime-壁-B/USR/BI/BR/bin/WunNuffe但设置参数-WNO C++非堆对象-FNO省略帧指针-G0-O2'-DyFifFiTySyOffice=1-DNDEBUG。。。(跳过剩余107个参数):com.google.devtools.build.lib.shell.badexitstatuseException:进程已退出,状态为4。 gcc:内部编译器错误:已终止(程序cc1plus) 请提交完整的bug报告, 如果合适,使用预处理源。 有关说明,请参阅。 Target//tensorflow/python/tools:strip\u unused无法生成 使用--verbose_failures查看失败构建步骤的命令行。 信息:运行时间:609.363s,关键路径:456.46s
我认为当操作系统终止gcc时会发生此错误。你有足够的内存/交换吗


我不认为这是Bazel或Tensorflow特有的。

这可能是因为内存不足。请在构建失败后立即发布
dmesg | tail的输出。

是,这是正确的。我通过运行
bazel build tensorflow/python/tools:strip\u unused--local\u resources 2048.5,1.0解决了这个问题