无法在Ubuntu 18.04

时间:2018-10-11 16:54:00

标签: tensorflow

当我尝试从源代码编译TensorFlow时,出现以下错误。我正在使用GPU Docker映像来运行构建。从理论上讲,哪一个都设置了所有适当的依赖项。

主机是Ubuntu 18.04。我在两台都装有最新Nvidia驱动程序的不同机器上收到此问题。一个拥有1080 TI,另一个拥有1060 nvidia卡。

基于tensorflow / tensorflow:1.11.0-devel-gpu构建docker映像。

我以交互方式运行它并运行./configure。

这是配置:

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


Found possible Python library paths:
  /usr/local/lib/python2.7/dist-packages
  /usr/lib/python2.7/dist-packages
Please input the desired Python library path to use.  Default is [/usr/local/lib/python2.7/dist-packages]

Do you wish to build TensorFlow with jemalloc as malloc support? [Y/n]: y
jemalloc as malloc support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: y
Google Cloud Platform support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: y
Hadoop File System support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Amazon AWS Platform support? [Y/n]: y
Amazon AWS Platform support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Apache Kafka Platform support? [Y/n]: y
Apache Kafka Platform support will be enabled for TensorFlow.

Do you wish to build TensorFlow with XLA JIT support? [y/N]: y
XLA JIT support will be enabled for TensorFlow.

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

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

Do you wish to build TensorFlow with nGraph support? [y/N]: y
nGraph 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.

Please specify the location where CUDA 9.0 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: 


Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: 


Please specify the location where TensorRT is installed. [Default is /usr/lib/x86_64-linux-gnu]:


Please specify the location where NCCL 2 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:


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]: 


Do you wish to build TensorFlow with MPI support? [y/N]: n
No MPI 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]: 


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 tools/bazel.rc for more details.
        --config=mkl            # Build with MKL support.
        --config=monolithic     # Config for mostly static monolithic build.
Configuration finished
root@17ed0ddbe2a4:/tensorflow# 

这是我得到的错误。

ERROR: /root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/ngraph_tf/BUILD.bazel:19:1: C++ compilation of rule '@ngraph_tf//:ngraph_tf' failed (Exit 1)
In file included from external/org_tensorflow/tensorflow/core/framework/common_shape_fns.h:22:0,
                 from external/org_tensorflow/tensorflow/core/framework/resource_mgr.h:24,
                 from external/org_tensorflow/tensorflow/core/common_runtime/device.h:43,
                 from external/org_tensorflow/tensorflow/core/common_runtime/device_set.h:23,
                 from external/org_tensorflow/tensorflow/core/common_runtime/optimization_registry.h:25,
                 from external/ngraph_tf/src/ngraph_encapsulate_pass.cc:23:
external/org_tensorflow/tensorflow/core/util/tensor_format.h: In function 'tensorflow::TensorShape tensorflow::ShapeFromFormat(tensorflow::TensorFormat, tensorflow::int64, tensorflow::gtl::ArraySlice<long long int>, tensorflow::int64)':
external/org_tensorflow/tensorflow/core/util/tensor_format.h:501:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (format == FORMAT_NHWC_VECT_W && dim == spatial.size() - 1) {
                                             ^
external/ngraph_tf/src/ngraph_encapsulate_pass.cc: In member function 'tensorflow::Status ngraph_bridge::NGraphEncapsulatePass::EncapsulateFunctions(tensorflow::Graph*)':
external/ngraph_tf/src/ngraph_encapsulate_pass.cc:393:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
           if (i < node->requested_inputs().size()) {
                 ^
external/ngraph_tf/src/ngraph_encapsulate_pass.cc:414:42: error: 'class absl::string_view' has no member named 'ToString'
             cluster_idx, tensor_id.first.ToString(), tensor_id.second));
                                          ^
In file included from external/org_tensorflow/tensorflow/core/platform/default/logging.h:24:0,
                 from external/org_tensorflow/tensorflow/core/platform/logging.h:25,
                 from external/org_tensorflow/tensorflow/core/lib/core/refcount.h:22,
                 from external/org_tensorflow/tensorflow/core/platform/tensor_coding.h:21,
                 from external/org_tensorflow/tensorflow/core/framework/resource_handle.h:19,
                 from external/org_tensorflow/tensorflow/core/framework/allocator.h:24,
                 from external/org_tensorflow/tensorflow/core/common_runtime/device.h:35,
                 from external/org_tensorflow/tensorflow/core/common_runtime/device_set.h:23,
                 from external/org_tensorflow/tensorflow/core/common_runtime/optimization_registry.h:25,
                 from external/ngraph_tf/src/ngraph_encapsulate_pass.cc:23:
external/org_tensorflow/tensorflow/core/util/tensor_format.h: In instantiation of 'T tensorflow::GetTensorDim(tensorflow::gtl::ArraySlice<T>, tensorflow::TensorFormat, char) [with T = long long int; tensorflow::gtl::ArraySlice<T> = absl::Span<const long long int>]':
external/org_tensorflow/tensorflow/core/util/tensor_format.h:452:47:   required from here
external/org_tensorflow/tensorflow/core/util/tensor_format.h:420:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   CHECK(index >= 0 && index < dimension_attributes.size())
                             ^
external/org_tensorflow/tensorflow/core/platform/macros.h:87:47: note: in definition of macro 'TF_PREDICT_FALSE'
 #define TF_PREDICT_FALSE(x) (__builtin_expect(x, 0))
                                               ^
external/org_tensorflow/tensorflow/core/util/tensor_format.h:420:3: note: in expansion of macro 'CHECK'
   CHECK(index >= 0 && index < dimension_attributes.size())
   ^
external/org_tensorflow/tensorflow/core/util/tensor_format.h: In instantiation of 'T tensorflow::GetFilterDim(tensorflow::gtl::ArraySlice<T>, tensorflow::FilterTensorFormat, char) [with T = long long int; tensorflow::gtl::ArraySlice<T> = absl::Span<const long long int>]':
external/org_tensorflow/tensorflow/core/util/tensor_format.h:461:54:   required from here
external/org_tensorflow/tensorflow/core/util/tensor_format.h:435:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   CHECK(index >= 0 && index < dimension_attribute.size())
                             ^
external/org_tensorflow/tensorflow/core/platform/macros.h:87:47: note: in definition of macro 'TF_PREDICT_FALSE'
 #define TF_PREDICT_FALSE(x) (__builtin_expect(x, 0))
                                               ^
external/org_tensorflow/tensorflow/core/util/tensor_format.h:435:3: note: in expansion of macro 'CHECK'
   CHECK(index >= 0 && index < dimension_attribute.size())
   ^
Target //tensorflow/tools/pip_package:build_pip_package failed to build

我对1.10图像也遇到同样的问题。或者尝试直接在主机上从源代码构建1.10或1.11。

1 个答案:

答案 0 :(得分:1)

似乎在此提交here上已解决。

还要检查首先在其上提到它的线程https://github.com/tensorflow/tensorflow/issues/22583

只需从大师那里拉回,然后尝试重新构建。