Gcc 为什么我会遇到Docker错误;C++;规则汇编'//tensorflow/核心:内核';失败;?

Gcc 为什么我会遇到Docker错误;C++;规则汇编'//tensorflow/核心:内核';失败;?,gcc,tensorflow,bazel,Gcc,Tensorflow,Bazel,当我执行以下操作时,会出现生成错误。我需要构建Tensorflow,因为我正在尝试添加自己的操作。如果不使用“-c opt”,我也会得到同样的错误。我做错了什么 $ docker run -it b.gcr.io/tensorflow/tensorflow-full root@3b2b67124684:~# cd /tensorflow/ root@3b2b67124684:/tensorflow# ./configure Do you wish to build TensorFlow with

当我执行以下操作时,会出现生成错误。我需要构建Tensorflow,因为我正在尝试添加自己的操作。如果不使用“-c opt”,我也会得到同样的错误。我做错了什么

$ docker run -it b.gcr.io/tensorflow/tensorflow-full
root@3b2b67124684:~# cd /tensorflow/
root@3b2b67124684:/tensorflow# ./configure
Do you wish to build TensorFlow with GPU support? [y/n] n
No GPU support will be enabled for TensorFlow

Configuration finished
root@3b2b67124684:/tensorflow# bazel build -c opt --verbose_failures //tensorflow/cc:tutorials_example_trainer
INFO: Reading 'startup' options from /root/.bazelrc: --batch
INFO: Found 1 target...
INFO: From Compiling tensorflow/core/kernels/argmax_op.cc:
gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
ERROR: /tensorflow/tensorflow/core/BUILD:210:1: C++ compilation of rule '//tensorflow/core:kernels' failed: gcc failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/tensorflow && \
  exec env - \
    INTERCEPT_LOCALLY_EXECUTABLE=1 \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
  /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -iquote . -iquote bazel-out/local_linux-opt/genfiles -isystem tools/cpp/gcc3 -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/gpus/cuda -isystem bazel-out/local_linux-opt/genfiles/third_party/gpus/cuda -isystem third_party/gpus/cuda/include -isystem bazel-out/local_linux-opt/genfiles/third_party/gpus/cuda/include -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -pthread -fno-exceptions -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/core/_objs/kernels/tensorflow/core/kernels/argmax_op.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/_objs/kernels/tensorflow/core/kernels/argmax_op.d -c tensorflow/core/kernels/argmax_op.cc -o bazel-out/local_linux-opt/bin/tensorflow/core/_objs/kernels/tensorflow/core/kernels/argmax_op.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 4: gcc failed: error executing command
  (cd /root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/tensorflow && \
  exec env - \
    INTERCEPT_LOCALLY_EXECUTABLE=1 \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
  /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -iquote . -iquote bazel-out/local_linux-opt/genfiles -isystem tools/cpp/gcc3 -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/gpus/cuda -isystem bazel-out/local_linux-opt/genfiles/third_party/gpus/cuda -isystem third_party/gpus/cuda/include -isystem bazel-out/local_linux-opt/genfiles/third_party/gpus/cuda/include -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -pthread -fno-exceptions -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/core/_objs/kernels/tensorflow/core/kernels/argmax_op.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/_objs/kernels/tensorflow/core/kernels/argmax_op.d -c tensorflow/core/kernels/argmax_op.cc -o bazel-out/local_linux-opt/bin/tensorflow/core/_objs/kernels/tensorflow/core/kernels/argmax_op.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 4.
Target //tensorflow/cc:tutorials_example_trainer failed to build
INFO: Elapsed time: 479.706s, Critical Path: 468.38s
$docker run-it b.gcr.io/tensorflow/tensorflow-full
root@3b2b67124684:~#cd/tensorflow/
root@3b2b67124684:/tensorflow#./配置
您是否希望使用GPU支持构建TensorFlow?[是/否]n
TensorFlow将不启用GPU支持
配置完成
root@3b2b67124684:/tensorflow#bazel build-c opt--verbose_失败//tensorflow/cc:tutorials_示例_trainer
信息:正在从/root/.bazelrc:--batch读取“启动”选项
信息:找到1个目标。。。
信息:来自编译tensorflow/core/kernels/argmax_op.cc:
gcc:内部编译器错误:已终止(程序cc1plus)
请提交完整的bug报告,
如果合适,使用预处理源。
有关说明,请参阅。
错误:/TysFrase/TysFrase/Cyr/Bug:210:1:规则'//TunSoRoo/Cype:C++内核编译:内核失败:GCC失败:错误执行命令
(cd/root/.cache/bazel/_bazel_root/68A62076E91007A7908BC42A32A32AE4CF9/tensorflow&&\
行政环境\
拦截\u本地\u可执行文件=1\
路径=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\
/usr/bin/gcc-U_-FORTIFY_-SOURCE'-D_-FORTIFY_-SOURCE=1'-fstack-protector-fPIE-Wall-Wunused但设置参数-Wno-free非堆对象-fno省略帧指针-g0-O2-DNDEBUG-ffunction-sections-fdata-sections'-std=c++0x'-ikote.-ikote-bazel out/local_linux-opt/genfiles-isystem-tools/cpp/gcc3-isystem google/protobuf/src-isystem bazel out/local_linux-opt/genfiles/google/protobuf/src-isystem external/jpeg_archive/jpeg-9a-isystem bazel out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a-isystem external/png_archive/libpng-1.2.53-isystem bazel out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53-isystem external/re2-isystem bazel out/local linux-opt/genfiles/eExternal/re2-isystem third_party/GPU/cuda-isystem bazel out/local_linux-opt/genfiles/third_party/GPU/cuda-isystem third_party/GPU/cuda/include-isystem bazel out/local_linux-opt/genfiles/third_party/GPU/cuda/include-isystem third_party/Egen3-isystem bazel out/local_linux-opt/genfiles/genfiles/third_party/Egen3-pthread-无例外al前缀-Wno内置宏重定义“-D_uuu日期uuu=“修订”'-D_uu时间戳uu=“修订”'-D_uu时间u=“修订”“”-frandom seed=bazel out/local_linux-opt/bin/tensorflow/core/_objs/kernels/tensorflow/core/kernels/argmax/argmax_op.o'-MD-MF bazel out/local_linux-opt/bin/tensorflow/core/_objs/kernels/tensorflow/argmax op.d-c tensorflow/core/argmax_op.cc-o bazel out/local_linux-opt/bin/tensorflow/core/_objs/core/core/_-core/core/core/tensorflow/core/core/coreax_op.o):com.google.devtools.build.lib.shell.BadExitStatusException:进程退出,状态为4:gcc失败:执行命令时出错
(cd/root/.cache/bazel/_bazel_root/68A62076E91007A7908BC42A32A32AE4CF9/tensorflow&&\
行政环境\
拦截\u本地\u可执行文件=1\
路径=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\
/usr/bin/gcc-U_-FORTIFY_-SOURCE'-D_-FORTIFY_-SOURCE=1'-fstack-protector-fPIE-Wall-Wunused但设置参数-Wno-free非堆对象-fno省略帧指针-g0-O2-DNDEBUG-ffunction-sections-fdata-sections'-std=c++0x'-ikote.-ikote-bazel out/local_linux-opt/genfiles-isystem-tools/cpp/gcc3-isystem google/protobuf/src-isystem bazel out/local_linux-opt/genfiles/google/protobuf/src-isystem external/jpeg_archive/jpeg-9a-isystem bazel out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a-isystem external/png_archive/libpng-1.2.53-isystem bazel out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53-isystem external/re2-isystem bazel out/local linux-opt/genfiles/eExternal/re2-isystem third_party/GPU/cuda-isystem bazel out/local_linux-opt/genfiles/third_party/GPU/cuda-isystem third_party/GPU/cuda/include-isystem bazel out/local_linux-opt/genfiles/third_party/GPU/cuda/include-isystem third_party/Egen3-isystem bazel out/local_linux-opt/genfiles/genfiles/third_party/Egen3-pthread-无例外al前缀-Wno内置宏重定义“-D_uuu日期uuu=“修订”'-D_uu时间戳uu=“修订”'-D_uu时间u=“修订”“”-frandom seed=bazel out/local_linux-opt/bin/tensorflow/core/_objs/kernels/tensorflow/core/kernels/argmax/argmax_op.o'-MD-MF bazel out/local_linux-opt/bin/tensorflow/core/_objs/kernels/tensorflow/argmax op.d-c tensorflow/core/argmax_op.cc-o bazel out/local_linux-opt/bin/tensorflow/core/_objs/core/core/_-core/core/core/tensorflow/core/core/coreax_op.o):com.google.devtools.build.lib.shell.BadExitStatusException:进程已退出,状态为4。
目标//tensorflow/cc:教程\u示例\u培训师无法生成
信息:运行时间:479.706s,关键路径:468.38s

我的退出代码4也有类似的问题(我认为内存不足)

我的解决方案是增加docker机器使用8GB。比如:

docker机器创建--驱动程序virtualbox--virtualbox内存8192--virtualbox cpu计数4默认值