Tensorflow r1.12及tensorflow serving r1.12 GPU版本编译遇到的问题

Posted zl1991

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Tensorflow r1.12及tensorflow serving r1.12 GPU版本编译遇到的问题相关的知识,希望对你有一定的参考价值。

1、git clone tensorflow serving 及tensorflow代码

2、

ERROR: /root/.cache/bazel/_bazel_root/f71d782da17fd83c84ed6253a342a306/external/local_config_cuda/crosstool/BUILD:4:1:
 Traceback (most recent call last):
        File "/root/.cache/bazel/_bazel_root/f71d782da17fd83c84ed6253a342a306/external/local_config_cuda/crosstool/BUILD", line 4
                error_gpu_disabled()
        File "/root/.cache/bazel/_bazel_root/f71d782da17fd83c84ed6253a342a306/external/local_config_cuda/crosstool/error_gpu_disabled.bzl", line 3, in error_gpu_disabled
                fail("ERROR: Building with --config=c...")
ERROR: Building with --config=cuda but TensorFlow is not configured to build with GPU support. Please re-run ./configure and enter Y at the prompt to build with GPU support.
ERROR: no such target @local_config_cuda//crosstool:toolchain: target toolchain not declared in package crosstool defined by /root/.cache/bazel/_bazel_root/f71d782da17fd83c84ed6253a342a306/external/local_config_cuda/crosstool/BUILD
INFO: Elapsed time: 0.093s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

解决办法:

export TF_NEED_CUDA="1"

3、看起来./configure配置全部不能生效,因此需要自己配置变量指引cuda、cudnn、nccl等所有的非默认路径

解决办法:通过变量设置

export PATH=$PATH:/env/bazel-0.15.0/bin
export TF_NEED_CUDA="1"
export CUDNN_INSTALL_PATH="/usr/local/cudnn7.3_cuda9.0"
export CUDA_INSTALL_PATH="/usr/local/cuda-9.0"
export TF_CUDA_VERSION="9.0"
export TF_CUDNN_VERSION="7"
export TF_NCCL_VERSION="2.2"
export NCCL_INSTALL_PATH="/env/nccl_2.2.13-1+cuda9.0_x86_64"
export TEST_TMPDIR=/home

 

失败,遇到nvcc检测cuda版本与设置不一致的问题。最后放弃,转而r1.13

以上是关于Tensorflow r1.12及tensorflow serving r1.12 GPU版本编译遇到的问题的主要内容,如果未能解决你的问题,请参考以下文章

tensorflow 有错误

02.Tensorflow基础用法

使用 tensorflow 我遇到了这样的错误

因tensorflow版本问题造成的error

[TensorFlow系列-1]:Tensorflow深度学习框架的详细安装过程

TensorFlow Android Camera Demo - 灰度图像分类