Tensorflow
python、tf 的版本根据需求选择。cudatoolkit 与本地 cuda 的版本相同,tf 必须安装 cudnn。
conda create -n tensor1.13 python=3.7
source activate tensor1.13
conda install cudatoolkit=10.0 cudnn
conda install tensorflow-gpu==1.13.1
python -c "import tensorflow as tf;print(tf.test.is_gpu_available())"
输出 True 则基本成功
Pytorch
在 PyTorch 的官网 https://pytorch.org/ ,根据需要选择,获得合适的 PyTorch 安装命令
conda create -n torch python=3.6
source activate torch
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
python -c "import torch;print(torch.cuda.is_available())"
输出 True 则基本成功