https://github.com/tensorflow/tensorflow/issues/10718上的同样问题

从master 0d2f691构建,但遇到错误“/ tensorflow / tools / pip_package / BUILD:94:1:没有这样的包'@ protobuf //':Traceback(最近的呼叫最后一次)” . 它们在virtualenv中运行,其中bazel为0.5.1,分数为7.3.1611 .

该软件包可以从网址“http://mirror.bazel.build/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz”下载到浏览器中 . 我在中国,很难访问谷歌服务 . 我不知道网络是否是问题 .

这是brach版本,配置和bazel构建的终端日志 .

(tf-source) [huwh1@huwh1-centos tensorflow]$ git branch -v
    master 0d2f691 [ahead 16] Create tf_env_collect.sh
(tf-source) [huwh1@huwh1-centos tensorflow]$ ./configure
You have bazel 0.5.1 installed.
Please specify the location of python. [Default is /home/huwh1/virtualenv/tf-source/bin/python]:
Found possible Python library paths:
/home/huwh1/virtualenv/tf-source/lib/python2.7/site-packages
Please input the desired Python library path to use. Default is [/home/huwh1/virtualenv/tf-source/lib/python2.7/site-packages]

Using python library path: /home/huwh1/virtualenv/tf-source/lib/python2.7/site-packages
Do you wish to build TensorFlow with MKL support? [y/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 use jemalloc as the malloc implementation? [Y/n]
jemalloc enabled
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N]
No Google Cloud Platform support will be enabled for TensorFlow
Do you wish to build TensorFlow with Hadoop File System support? [y/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]
No XLA support will be enabled for TensorFlow
Do you wish to build TensorFlow with VERBS support? [y/N]
No VERBS support will be enabled for TensorFlow
Do you wish to build TensorFlow with OpenCL support? [y/N]
No OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N] y
CUDA support will be enabled for TensorFlow
Do you want to use clang as CUDA compiler? [y/N]
nvcc will be used as CUDA compiler
Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to default to CUDA 8.0]: 8.0
Please specify the location where CUDA 8.0 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:
Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 6.0]: 5
Please specify the location where cuDNN 5 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Please specify a list of comma-separated Cuda compute capabilities you want to build with.
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your build time and binary size.
[Default is: "3.5,5.2"]: 3.0
Do you wish to build TensorFlow with MPI support? [y/N]
MPI support will not be enabled for TensorFlow
Configuration finished

(tf-source) [huwh1@huwh1-centos tensorflow]$ bazel clean
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.
(tf-source) [huwh1@huwh1-centos tensorflow]$ bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package | tee
____Loading package: tensorflow/tools/pip_package
____Loading package: @bazel_tools//tools/cpp
____Loading package: tensorflow/contrib/specs
____Loading package: @zlib_archive//
____Loading package: third_party/eigen3
____Downloading http://mirror.bazel.build/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz: 87,161 bytes
____Downloading http://mirror.bazel.build/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz: 311,205 bytes
____Downloading http://mirror.bazel.build/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz: 1,475,383 bytes
____Downloading http://mirror.bazel.build/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz: 1,957,187 bytes
____Downloading http://mirror.bazel.build/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz: 4,274,206 bytes
____Downloading http://mirror.bazel.build/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz: 2,138,182 bytes
____Downloading http://mirror.bazel.build/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz: 1,875,852 bytes
____Downloading http://mirror.bazel.build/github.com/google/protobuf/archive/2b7430d96aeff2bb624c8d52182ff5e4b9f7f18a.tar.gz: 4,264,858 bytes
ERROR: /home/huwh1/git/tensorflow/tensorflow/tools/pip_package/BUILD:94:1: no such package '@protobuf//': Traceback (most recent call last):
File "/home/huwh1/git/tensorflow/tensorflow/workspace.bzl", line 122
_apply_patch(repo_ctx, repo_ctx.attr.patch_file)
File "/home/huwh1/git/tensorflow/tensorflow/workspace.bzl", line 113, in _apply_patch
_execute_and_check_ret_code(repo_ctx, cmd)
File "/home/huwh1/git/tensorflow/tensorflow/workspace.bzl", line 97, in _execute_and_check_ret_code
fail("Non-zero return code({1}) when ..., <2 more arguments>))
Non-zero return code(256) when executing 'patch -p1 -d /home/huwh1/.cache/bazel/_bazel_huwh1/571d325cc1cf529816d64b96c622cea4/external/protobuf -i /home/huwh1/git/tensorflow/third_party/protobuf/add_noinlines.patch':
Stdout:
Stderr: java.io.IOException: Cannot run program "patch" (in directory "/home/huwh1/.cache/bazel/_bazel_huwh1/571d325cc1cf529816d64b96c622cea4/external/protobuf"): error=2, No such file or directory and referenced by '//tensorflow/tools/pip_package:licenses'.
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted.
____Elapsed time: 3.457s

这是系统信息:

== cat /etc/issue ===============================================
Linux huwh1-centos 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
VERSION="7 (Core)"
VERSION_ID="7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

== are we in docker =============================================
No

== compiler =====================================================
c++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

== uname -a =====================================================
Linux huwh1-centos 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

== check pips ===================================================
numpy (1.13.0)
protobuf (3.3.0)

== check for virtualenv =========================================
True

== tensorflow import ============================================
Traceback (most recent call last):
File "", line 1, in
File "tensorflow/init.py", line 24, in
from tensorflow.python import *
File "tensorflow/python/init.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "tensorflow/python/pywrap_tensorflow.py", line 52, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "tensorflow/python/pywrap_tensorflow.py", line 41, in
from tensorflow.python.pywrap_tensorflow_internal import *
ImportError: No module named pywrap_tensorflow_internal

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

== env ==========================================================
LD_LIBRARY_PATH /opt/intel/compilers_and_libraries_2017.4.196/linux/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2017.4.196/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2017.4.196/linux/tbb/lib/intel64_lin/gcc4.7:/opt/intel/compilers_and_libraries_2017.4.196/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2017.4.196/linux/mkl/lib/intel64_lin:/usr/local/cuda-8.0/lib64
DYLD_LIBRARY_PATH is unset

== nvidia-smi ===================================================
Thu Jun 15 10:28:42 2017
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 375.26 Driver Version: 375.26 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro K420 Off | 0000:01:00.0 Off | N/A |
| 25% 44C P8 N/A / N/A | 9MiB / 1998MiB | 0% Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 6899 C /home/huwh1/virtualenv/tf-gpu/bin/python 7MiB |
+-----------------------------------------------------------------------------+

== cuda libs ===================================================
/usr/local/cuda-8.0/lib64/libcudart_static.a
/usr/local/cuda-8.0/lib64/libcudart.so.8.0.61
/usr/local/cuda-8.0/doc/man/man7/libcudart.so.7
/usr/local/cuda-8.0/doc/man/man7/libcudart.7