Tensorflow ubuntu 14.04上的TF安装失败

Tensorflow ubuntu 14.04上的TF安装失败,tensorflow,Tensorflow,我得到了一个奇怪的配置错误,我无法破译。似乎没有其他ppl遇到过这种情况。CUDA配置正确。什么是“存储库规则”和“外部”包 (tensorflow)weiwe@weiwe:~/tensorflow$ ./configure Please specify the location of python. [Default is /home/weiwe/tensorflow/bin/python]: Do you wish to build TensorFlow with Google Clou

我得到了一个奇怪的配置错误,我无法破译。似乎没有其他ppl遇到过这种情况。CUDA配置正确。什么是“存储库规则”和“外部”包

(tensorflow)weiwe@weiwe:~/tensorflow$ ./configure 
Please specify the location of python. [Default is /home/weiwe/tensorflow/bin/python]: 
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] 
No Google Cloud Platform support will be enabled for TensorFlow
Traceback (most recent call last):
  File "<stdin>", line 18, in <module>
TypeError: can only concatenate list (not "str") to list
Found possible Python library paths:
Please input the desired Python library path to use.  Default is []
/home/weiwe/tensorflow/lib/python2.7/site-packages
Do you wish to build TensorFlow with GPU support? [y/N] y
GPU support will be enabled for TensorFlow
Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]: 
Please specify the Cuda SDK version you want to use, e.g. 7.0. [Leave empty to use system default]: 
Please specify the location where CUDA  toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: 
Please specify the Cudnn version you want to use. [Leave empty to use system default]: 
Please specify the location where cuDNN  library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: 
libcudnn.so resolves to libcudnn.4
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"]: 
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
.........
ERROR: /home/weiwe/tensorflow/third_party/gpus/cuda_configure.bzl:415:18: function 'repository_rule' does not exist.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package 'external': Extension file '@local_config_cuda//cuda:build_defs.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
Configuration finished
(tensorflow)weiwe@weiwe:~/tensorflow$ bazel build -c opt --config=cuda \
>     //tensorflow/tools/pip_package:build_pip_package
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package 'external': Extension file '@local_config_cuda//cuda:build_defs.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
INFO: Elapsed time: 0.380s
(tensorflow)weiwe@weiwe:~/tensorflow$ bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package 'external': Extension file '@local_config_cuda//cuda:build_defs.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
INFO: Elapsed time: 0.109s
(tensorflow)weiwe@weiwe:~/tensorflow$ bazel clean
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
(tensorflow)weiwe@weiwe:~/tensorflow$ bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package 'external': Extension file '@local_config_cuda//cuda:build_defs.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
INFO: Elapsed time: 0.242s
(tensorflow)weiwe@weiwe:~/tensorflow$/配置
请指定python的位置。[默认值为/home/weiwe/tensorflow/bin/python]:
您是否希望使用谷歌云平台支持构建TensorFlow?[是/否]
TensorFlow将不支持Google云平台
回溯(最近一次呼叫最后一次):
文件“”,第18行,在
TypeError:只能将列表(而不是“str”)连接到列表
找到可能的Python库路径:
请输入所需的Python库路径以供使用。默认值为[]
/home/weiwe/tensorflow/lib/python2.7/site-packages
您是否希望使用GPU支持构建TensorFlow?[y/N]y
将为TensorFlow启用GPU支持
请指定nvcc应使用哪个gcc作为主机编译器。[默认值为/usr/bin/gcc]:
请指定要使用的Cuda SDK版本,例如7.0。[保留为空以使用系统默认值]:
请指定CUDA toolkit的安装位置。有关更多详细信息,请参阅README.md。[默认值为/usr/local/cuda]:
请指定要使用的Cudnn版本。[保留为空以使用系统默认值]:
请指定cuDNN库的安装位置。有关更多详细信息,请参阅README.md。[默认值为/usr/local/cuda]:
libcudnn.so决定使用libcudnn.4
请指定要使用的逗号分隔Cuda计算功能的列表。
您可以在以下位置找到设备的计算能力:https://developer.nvidia.com/cuda-gpus.
请注意,每个额外的计算功能都会显著增加构建时间和二进制大小。
[默认值为:“3.5,5.2”]:
信息:开始清理(这可能需要一段时间)。如果使用清洁超过几分钟,请考虑使用ExpungE.AsiNC。
.........
错误:/home/weiwe/tensorflow/third_party/gpus/cuda_configure。bzl:415:18:函数“存储库规则”不存在。
错误:com.google.devtools.build.lib.packages.buildFileContainerErrorException:加载包“外部”时出错:扩展文件“@local\u config\u cuda//cuda:build\u defs.bzl”可能无法从工作区文件加载,因为该扩展文件位于外部存储库中。
配置完成
(张量流)weiwe@weiwe:~/tensorflow$bazel build-c opt--config=cuda\
>//tensorflow/tools/pip\u包:build\u pip\u包
错误:com.google.devtools.build.lib.packages.buildFileContainerErrorException:加载包“外部”时出错:扩展文件“@local\u config\u cuda//cuda:build\u defs.bzl”可能无法从工作区文件加载,因为该扩展文件位于外部存储库中。
信息:运行时间:0.380s
(张量流)weiwe@weiwe:~/tensorflow$bazel build-c opt--config=cuda//tensorflow/cc:tutorials\u example\u trainer
错误:com.google.devtools.build.lib.packages.buildFileContainerErrorException:加载包“外部”时出错:扩展文件“@local\u config\u cuda//cuda:build\u defs.bzl”可能无法从工作区文件加载,因为该扩展文件位于外部存储库中。
信息:运行时间:0.109s
(张量流)weiwe@weiwe:~/tensorflow$bazel clean
信息:开始清理(这可能需要一段时间)。如果使用清洁超过几分钟,请考虑使用ExpungE.AsiNC。
(张量流)weiwe@weiwe:~/tensorflow$bazel build-c opt--config=cuda//tensorflow/cc:tutorials\u example\u trainer
错误:com.google.devtools.build.lib.packages.buildFileContainerErrorException:加载包“外部”时出错:扩展文件“@local\u config\u cuda//cuda:build\u defs.bzl”可能无法从工作区文件加载,因为该扩展文件位于外部存储库中。
信息:运行时间:0.242s

cuda构建层最近有一个补丁。一旦你犯了那个错误

Error loading package 'external': Extension file '@local_config_cuda//cuda:build_defs.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
您必须再次运行
/configure
,才能重新创建该目标

这可能会让人厌烦,跳过配置过程的一种方法是从命令行提供变量设置

PYTHON_BIN_PATH=$HOME/anaconda2/bin/python CUDA_TOOLKIT_PATH="/usr/local/cuda" CUDNN_INSTALL_PATH="/usr/local/cuda" TF_NEED_CUDA=1 TF_CUDA_COMPUTE_CAPABILITIES="6.1" TF_CUDNN_VERSION="5" TF_CUDA_VERSION="8.0" TF_CUDA_VERSION_TOOLKIT=8.0 ./configure
希望能有帮助