xubuntu 19.10安装tensorflow-gpu-2.0(本文很乱,供自己参考)

笔记本电脑 神州战神 Z8-CT7NT

1. 先安装miniconda

2.由于后期可能会遇到一个问题,所以可以先安装 grpcio

conda install grpcio

3. 由于我这边 tensorflow 下载太慢,所以我还是先用迅雷把安装包下载了下来

https://files.pythonhosted.org/packages/a1/eb/bc0784af18f612838f90419cf4805c37c20ddb957f5ffe0c42144562dcfa/tensorflow_gpu-2.0.0-cp37-cp37m-manylinux2010_x86_64.whl

然后执行

pip install tensorflow_gpu-2.0.0-cp37-cp37m-manylinux2010_x86_64.whl

4. 安装完之后我试着import,没有看到报错,暂时先这样,后面感觉应该是需要安装cuda的,不知道是不是安装好了,需要了再补充

 

本文完

 

--------------------------------------------------------------

如果编译tensorflow 2.0 gpu版本,默认依赖cuda版本为10.0,我用network版本安装cuda,默认的驱动版本为libnvidia-common-418,而xubuntu19.10默认的驱动版本为libnvidia-common-435

编译tensorflow gpu版本时,由于cuda 不支持gcc 8以上的版本,而xubuntu 19.10默认的gcc版本为9.2.1,所以会编译失败

ERROR: /home/luke/Download/tensorflow2.0/tensorflow/core/kernels/BUILD:4354:1: error while parsing .d file: /home/luke/.cache/bazel/_bazel_luke/dc9bc00a98b191c89942ea348cf764a3/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/core/kernels/_objs/in_topk_op_gpu/in_topk_op_gpu.cu.pic.d (No such file or directory)
In file included from /usr/local/cuda/bin/../targets/x86_64-linux/include/cuda_runtime.h:83,
                 from :
/usr/local/cuda/bin/../targets/x86_64-linux/include/crt/host_config.h:138:2: error: #error -- unsupported GNU version! gcc versions later than 8 are not supported!
  138 | #error -- unsupported GNU version! gcc versions later than 8 are not supported!
      |  ^~~~~
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 235.781s, Critical Path: 47.78s
INFO: 1476 processes: 1476 local.
FAILED: Build did NOT complete successfully
 

 

_______________________________________

编译TensorFlow CPU版本时,我这边也失败了,报错如下

INFO: Deleting stale sandbox base /home/luke/.cache/bazel/_bazel_luke/dc9bc00a98b191c89942ea348cf764a3/sandbox
ERROR: /home/luke/.cache/bazel/_bazel_luke/dc9bc00a98b191c89942ea348cf764a3/external/grpc/BUILD:507:1: C++ compilation of rule '@grpc//:gpr_base' failed (Exit 1)
external/grpc/src/core/lib/gpr/log_linux.cc:43:13: error: ambiguating new declaration of 'long int gettid()'
   43 | static long gettid(void) { return syscall(__NR_gettid); }
      |             ^~~~~~
In file included from /usr/include/unistd.h:1170,
                 from external/grpc/src/core/lib/gpr/log_linux.cc:41:
/usr/include/x86_64-linux-gnu/bits/unistd_ext.h:34:16: note: old declaration '__pid_t gettid()'
   34 | extern __pid_t gettid (void) __THROW;
      |                ^~~~~~
external/grpc/src/core/lib/gpr/log_linux.cc:43:13: warning: 'long int gettid()' defined but not used [-Wunused-function]
   43 | static long gettid(void) { return syscall(__NR_gettid); }
      |             ^~~~~~
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 8.415s, Critical Path: 0.57s
INFO: 11 processes: 11 local.
FAILED: Build did NOT complete successfully

你可能感兴趣的:(TensorFlow)