gpt4 book ai didi

c++ - 使用bazel从源代码构建 tensorflow 服务遇到错误: C++ compilation of rule '@org_tensorflow//…' failed (Exit 4)

转载 作者:行者123 更新时间:2023-12-02 10:59:09 25 4
gpt4 key购买 nike

我正在尝试使用bazel在CentOS 7.3上从https://github.com/tensorflow/serving构建tensorflow-serving。我的gcc版本是4.8.5,bazel版本是0.10.1。我确信我已经按照安装说明进行了准备,并且已经设置了所有要求的先决条件。每次我运行命令:
bazel build -c选择tensorflow_serving/model_servers/...
它将运行大约10〜15分钟,然后由于错误而停止:

ERROR:
/root/.cache/bazel/_bazel_root/2d16d9349bff8cf3d8fc4a53d2a23056/external/org_tensorflow/tensorflow/core/kernels/BUILD:3120:1: C++ compilation of rule '@org_tensorflow//tensorflow/core/kernels:conv_ops' failed (Exit 4)
gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
INFO: Elapsed time: 881.803s, Critical Path: 37.21s
FAILED: Build did NOT complete successfully

如果我尝试其他命令:
bazel build -c opt tensorflow_serving/model_servers/...

为了专门建立服务的子目录,错误如下:
ERROR: 
/home/serving/tensorflow_serving/batching/BUILD:122:1: C++ compilation of rule '//tensorflow_serving/batching:batching_util' failed (Exit 4)
tensorflow_serving/batching/batching_util.cc: In function 'std::map<std::basic_string<char>, std::vector<int> > tensorflow::serving::CalculateMaxDimSizes(const std::vector<std::vector<std::pair<std::basic_string<char>, tensorflow::Tensor> > >&)':
tensorflow_serving/batching/batching_util.cc:165:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < batch.size(); ++i) {
^
gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
INFO: Elapsed time: 1486.641s, Critical Path: 211.94s
FAILED: Build did NOT complete successfully

请原谅我的英语不好,并帮助我...我在这个问题上困扰了很长时间。

最佳答案

在TensorFlow的Github上发现了类似的问题(349),很可能您的内存不足。他们建议添加参数“--jobs 1 --local_resources 2048,.5,1.0”,以便Bazel一次生成不超过一个编译器进程,并限制系统资源的使用。

关于c++ - 使用bazel从源代码构建 tensorflow 服务遇到错误: C++ compilation of rule '@org_tensorflow//…' failed (Exit 4),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49166562/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com