- 安装NVIDIA驱动: 软件和更新->附加驱动
- 安装cuda:
sudo apt install nvidia-cuda-toolkit
- pytorch安装:
1)换清华的镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
2)官网查询自己环境对应的pytorch版本安装命令
官网提供如下:
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch
这样还是很慢,应该去掉 -c pytorch
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0