|
ubuntu18.04上安装cuda10.1后的tf与pytorch的版本选择问题
本机系统:nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
安装的是 cuda 10.1
如需了解可用于旧版 TensorFlow 的 CUDA® 和 cuDNN 版本,请参阅经过测试的构建配置。
则tensorflow-gpu必须是 tensorflow-2.1.0
参考官网:https://tensorflow.google.cn/install/source#linux
pip3 install tensorflow==2.1.0
pip3 install keras==2.3.1
pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
通过tf看的:tf.test.is_gpu_available()
physical GPU (device: 0, name: GeForce GT 730, pci bus id: 0000:01:00.0, compute capability: 3.5)
physical GPU (device: 0, name: GeForce RTX 2070, pci bus id: 0000:01:00.0, compute capability: 7.5)
Python 3.6.10 |Anaconda, Inc.| (default, May 8 2020, 02:54:21)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch as T
>>> T.__version__
'1.7.1+cu101'
>>> T.cuda.is_available()
True
大功告成!
|
|