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 <command-line>:
/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
總結
以上是生活随笔為你收集整理的xubuntu 19.10安装tensorflow-gpu-2.0(本文很乱,供自己参考)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android Studio 的安装笔记
- 下一篇: tensorflow object_de