Bazel 构建 Retrainer 失败

Failed to build Retrainer by Bazel

在 OSX(10.9.5) 上 this 之后在 TensorFlow 中安装再训练器时,Bazel:0.2.2-b,CUDA:7.5,cuDNN:v5python:2.7

$bazel build tensorflow/examples/image_retraining:retrain

我遇到了以下错误。有什么想法吗?

ERROR: /Users/hoshinotoshihiko/tensorflow/google/protobuf/BUILD:272:1: C++ compilation of rule '//google/protobuf:protoc' failed: osx_cc_wrapper.sh failed:

error executing command (cd/private/var/tmp/_bazel_hoshinotoshihiko/ff5db7423b3afa0d045a736d77207f89/tensorflow && \exec env - \PATH='/usr/local/lib:/usr/lib:/Users/hoshinotoshihiko/exec -l /bin/bash/google-cloud-sdk/bin:/usr/local/cuda/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/hoshinotoshihiko/bin'TMPDIR=/var/folders/y6/78v3zz4j1bj6nq7bl82c3cj80000gn/T/ \external/local_config_cc/osx_cc_wrapper.sh -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -g0 '-std=c++0x' -iquote . -iquote bazel-out/host/genfiles -iquote external/bazel_tools -iquote bazel-out/host/genfiles/external/bazel_tools -isystem google/protobuf/src -isystem bazel-out/host/genfiles/google/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o' -MD -MF bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.d -c google/protobuf/src/google/protobuf/compiler/main.cc -o bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o):

com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 126.

external/local_config_cc/osx_cc_wrapper.sh: line 56: /usr/local/lib/gcc: is a directory

Target //tensorflow/examples/image_retraining:retrain failed to build

INFO: Elapsed time: 20.672s, Critical Path: 20.22s

尝试从 google 的张量流 dockerfile 开始:

https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/tools/docker/Dockerfile.devel

如果您在该环境中遇到问题,请重新post。

是机器性能问题
通过换机(MacBook Air(Mid2012)(4GB内存)→MacBook Pro(Mid2014)(16GB内存),我得以搭建。