在 OSX 上使用 Docker 的 Tensorflow 服务编译错误 [英] Tensorflow Serving Compile Error Using Docker on OSX

查看:26
本文介绍了在 OSX 上使用 Docker 的 Tensorflow 服务编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Docker 在 OSX El Capitan 上安装 TensorFlow 服务,但一直遇到错误.这是我正在遵循的教程:

I'm trying to install TensorFlow serving on OSX El Capitan using Docker but keep running into an error. Here is the tutorial I'm following:

https://tensorflow.github.io/serving/docker.html

这是导致错误的命令:

bazel test tensorflow_serving/...

这是我得到的错误:

for (int i = 0; i < suffix.size(); ++i) {
                                   ^
ERROR: /root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/tf/tensorflow/core/kernels/BUILD:212:1: C++ compilation of rule '@tf//tensorflow/core/kernels:mirror_pad_op' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -iquote external/tf -iquote ... (remaining 65 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.

推荐答案

已解决!看起来问题在于 VM 中的内存不足.

Solved! Looks like the issues was with running out of memory in the VM.

这是我修复它的方法:

1) 创建机器时,确保它有更多内存(我的只有 1GB).以下是创建 4GB docker 机器的方法:

1) When creating the machine, make sure it has more memory (mine was only 1GB). Here is how you create a docker machine with 4GB:

docker-machine create -d virtualbox --virtualbox-memory 4096 default

2) 运行 bazel 命令时,传入一个限制要使用的内存量的参数.在这里,我仅使用 2GB 运行命令:

2) When running the bazel command pass in a parameter limiting the amount of memory to use. Here I'm running the command using only 2GB:

bazel build -c opt --copt=-mavx --verbose_failures --local_resources 2048,2.0,1.0 -j 1 //tensorflow_serving/example:mnist_export 

原始命令在哪里:

bazel build //tensorflow_serving/example:mnist_export

这篇关于在 OSX 上使用 Docker 的 Tensorflow 服务编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆