Bazel在为TensorFlow构建pip包时遇到问题,仅支持CPU

时间:2017-05-22 14:18:16

标签: tensorflow pip bazel

家伙!我正在尝试按照Installing TensorFlow from Sources中的步骤为tensorflow构建一个pip包。在调用以下命令之后:$ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package,我得到以下内容:

ERROR: error loading package '': Encountered error while reading extension file
'closure/defs.bzl': no such package '@io_bazel_rules_closure//closure': Error do
wnloading [http://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive
/aac19edc557aec9b603cd7ffe359401264ceff0d.tar.gz, https://github.com/bazelbuild/
rules_closure/archive/aac19edc557aec9b603cd7ffe359401264ceff0d.tar.gz] to /priva
te/var/tmp/_bazel_WilliamHuang/75f5fa598a7d55b225c399e7e82a3908/external/io_baze
l_rules_closure/aac19edc557aec9b603cd7ffe359401264ceff0d.tar.gz: All mirrors are
down: [].
INFO: Elapsed time: 58.126s

我的./configure如下:

Do you wish to build TensorFlow with MKL support? [y/N] n
No MKL support will be enabled for TensorFlow
Please specify optimization flags to use during compilation when 
bazel option "--config=opt" is specified [Default is -march=native]: 
Do you wish to build TensorFlow with Google Cloud Platform support? 
[y/N] n
No Google Cloud Platform support will be enabled for TensorFlow
Do you wish to build TensorFlow with Hadoop File System support? 
[y/N] n
No Hadoop File System support will be enabled for TensorFlow
Do you wish to build TensorFlow with the XLA just-in-time compiler 
(experimental)? [y/N] n
No XLA JIT support will be enabled for TensorFlow
Do you wish to build TensorFlow with VERBS support? [y/N] n
No VERBS support will be enabled for TensorFlow
Do you wish to build TensorFlow with OpenCL support? [y/N] n
No OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N] n
No CUDA support will be enabled for TensorFlow

我的bazel版本是0.4.5

Build label: 0.4.5-homebrew

希望你们能帮我解决这个问题。提前谢谢。

1 个答案:

答案 0 :(得分:0)

我通过在$ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package之前设置代理

解决了这个问题
export http_proxy=http://proxy_ip:port  (e.g. export http_proxy=http://10.110.0.25:8888)
export https_proxy=http://proxy_ip:port