下载安装英伟达CUDA10.1 https://developer.nvidia.com/cuda-10.1-download-archive-base
-
搜索栏输入cmd,以管理员方式打开cmd
-
更换清华大学开源下载库,pytorch版本为1.4.0
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/ -
安装 PyTorch
conda install pytorch torchvision cudatoolkit=10.1 -
测试是否安装成功
打开Anaconda Prompt (Anaconda3)
输入 python
1.import torch
2.print(torch.__version删除线格式__)
3.print(torch.version.cuda)
4.print(torch.cuda.is_available())