Python 3.x 从源代码构建Tensorflow时,Bazel返回规则链接错误

Python 3.x 从源代码构建Tensorflow时,Bazel返回规则链接错误,python-3.x,tensorflow,bazel,Python 3.x,Tensorflow,Bazel,我试图让InfoGAN代码从GitHub运行,但当我试图从推荐的源代码构建Tensorflow时,错误不断出现。它可以正常运行约30分钟,然后崩溃(即使使用sudo) 错误如下: ERROR: /home/socialab/Desktop/tensorflow-master/tensorflow/python/BUILD:2436:1: Linking of rule '//tensorflow/python:gen_stateless_random_ops_py_wrappers_cc' fa

我试图让InfoGAN代码从GitHub运行,但当我试图从推荐的源代码构建Tensorflow时,错误不断出现。它可以正常运行约30分钟,然后崩溃(即使使用sudo)

错误如下:

ERROR: /home/socialab/Desktop/tensorflow-master/tensorflow/python/BUILD:2436:1: Linking of rule '//tensorflow/python:gen_stateless_random_ops_py_wrappers_cc' failed (Exit 1)
bazel-out/host/bin/tensorflow/core/libop_gen_lib.a(op_gen_lib.o): In function `google::protobuf::internal::ArenaStringPtr::CreateInstance(google::protobuf::Arena*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*)':
op_gen_lib.cc:(.text._ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x36): undefined reference to `google::protobuf::internal::ArenaImpl::AllocateAlignedAndAddCleanup(unsigned long, void (*)(void*))'
ERROR:/home/socialab/Desktop/tensorflow master/tensorflow/python/BUILD:2436:1:链接规则“//tensorflow/python:gen\u stateless\u random\u ops\u py\u wrappers\u cc”失败(出口1)
bazel out/host/bin/tensorflow/core/libop_gen_lib.a(op_gen_lib.o):在函数“google::protobuf::internal::ArenaStringPtr::CreateInstance(google::protobuf::Arena*,std::_cx11::basic_string const*)”中:
op_gen_lib.cc:(.text._zn6谷歌8Protobuf8Internal14AreastringPTR14CreateInstanceEPNS0_5ArenaEPKNSt7_cx1112基本字符串T11Char_TraitsICeSaeee[_zn6谷歌8Protobuf8Internal14AreastringPTR14CreateInstanceEPNS0_5ArenaEPKNSt7_cx1112;基本字符串T11Char_TraitsICeSaeee]+0x36):对“google::protobuf::internal::ArenaImpl::AllocateAlignedAndddCleanup(未签名长,void(*)(void*)”的未定义引用
配置Tensorflow时,我几乎对所有东西都说不(除了CUDA),比如:

WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
You have bazel 0.29.1 installed.
Please specify the location of python. [Default is /usr/bin/python]: /usr/bin/python3


Found possible Python library paths:
  /usr/lib/python3/dist-packages
  /usr/local/lib/python3.6/dist-packages
Please input the desired Python library path to use.  Default is [/usr/lib/python3/dist-packages]
/usr/local/lib/python3.6/dist-packages
Do you wish to build TensorFlow with XLA JIT support? [Y/n]: n
No XLA JIT support will be enabled for TensorFlow.

Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: n
No OpenCL SYCL support will be enabled for TensorFlow.

Do you wish to build TensorFlow with ROCm support? [y/N]: n
No ROCm 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 wish to build TensorFlow with TensorRT support? [y/N]: n
No TensorRT support will be enabled for TensorFlow.

Found CUDA 10.1 in:
    /usr/local/cuda/lib64
    /usr/local/cuda/include
Found cuDNN 7 in:
    /usr/lib/x86_64-linux-gnu
    /usr/include


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, and that TensorFlow only supports compute capabilities >= 3.5 [Default is: 7.5]: 7.5


Do you want to use clang as CUDA compiler? [y/N]: n
nvcc will be used as CUDA compiler.

Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]: 


Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]: 


Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
Not configuring the WORKSPACE for Android builds.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
    --config=mkl            # Build with MKL support.
    --config=monolithic     # Config for mostly static monolithic build.
    --config=ngraph         # Build with Intel nGraph support.
    --config=numa           # Build with NUMA support.
    --config=dynamic_kernels    # (Experimental) Build kernels into separate shared objects.
    --config=v2             # Build TensorFlow 2.x instead of 1.x.
Preconfigured Bazel build configs to DISABLE default on features:
    --config=noaws          # Disable AWS S3 filesystem support.
    --config=nogcp          # Disable GCP support.
    --config=nohdfs         # Disable HDFS support.
    --config=nonccl         # Disable NVIDIA NCCL support.
Configuration finished
警告:--批处理模式已弃用。请改为使用命令“Bazel shutdown”显式关闭Bazel服务器。
您已经安装了bazel 0.29.1。
请指定python的位置。[默认值为/usr/bin/python]:/usr/bin/python3
找到可能的Python库路径:
/usr/lib/python3/dist包
/usr/local/lib/python3.6/dist-packages
请输入所需的Python库路径以供使用。默认值为[/usr/lib/python3/dist-packages]
/usr/local/lib/python3.6/dist-packages
您希望用XLA JIT支持构建张量流吗?[是/否]:否
TensorFlow将不启用XLA JIT支持。
您是否希望使用OpenCL SYCL支持构建TensorFlow?[是/否]:否
不会为TensorFlow启用OpenCL SYCL支持。
您是否希望使用ROCm支持构建TensorFlow?[是/否]:否
TensorFlow将不启用ROCm支持。
您是否希望使用CUDA支持构建TensorFlow?[是/否]:是
将为TensorFlow启用CUDA支持。
您是否希望使用TensorRT支持构建TensorFlow?[是/否]:否
不会为TensorFlow启用TensorRT支持。
在以下位置找到CUDA 10.1:
/usr/local/cuda/lib64
/usr/本地/cuda/包括
在以下位置找到cuDNN 7:
/usr/lib/x86_64-linux-gnu
/usr/包括
请指定要使用的逗号分隔CUDA计算功能的列表。
您可以在以下位置找到设备的计算能力:https://developer.nvidia.com/cuda-gpus.
请注意,每个额外的计算功能都会显著增加构建时间和二进制大小,TensorFlow只支持计算功能>=3.5[默认值为:7.5]:7.5]
您想使用clang作为CUDA编译器吗?[是/否]:否
nvcc将用作CUDA编译器。
请指定nvcc应使用哪个gcc作为主机编译器。[默认值为/usr/bin/gcc]:
请指定编译期间在指定bazel选项“-config=opt”时使用的优化标志[默认值为-march=native-Wno sign compare]:
是否要以交互方式为Android版本配置./WORKSPACE?[是/否]:否
未为Android版本配置工作区。
预配置的Bazel构建配置。您可以通过在build命令中添加“-config=”来使用以下任一选项。有关更多详细信息,请参见.bazelrc。
--config=mkl#使用mkl支持构建。
--配置=单片#配置主要用于静态单片构建。
--config=ngraph#使用英特尔ngraph支持构建。
--config=numa#使用numa支持构建。
--config=dynamic_kernels(实验性)将内核构建到单独的共享对象中。
--config=v2#构建TensorFlow 2.x而不是1.x。
预配置的Bazel build配置为禁用默认功能:
--config=noaws#禁用AWS S3文件系统支持。
--config=nogcp#禁用GCP支持。
--config=nohdfs#禁用HDFS支持。
--config=nonccl#禁用NVIDIA NCCL支持。
配置完成
我使用的是推荐的Bazel版本(0.29.1)、CUDA10.1、CUDNN7.6.4和430.50驱动程序。 系统规格: Ubuntu 18.04 RTX 2080钛 i5-8600K 8GB内存


非常感谢您的帮助。谢谢

我认为Tensorflow只支持CUDA 10.0。我认为Tensorflow只支持CUDA 10.0。