安装anaconda,以及创建新的环境就不再赘述。
直接从环境配置开始
conda activate your_env后;
1、优先设置一下conda的清华源,下载会很快。
依次输入以下四条指令
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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
2、进入pytorch官网,安装torch
选择合适的选项,复制最下面一行到CMD中执行
3、安装cuda,cudatoolkit,cuDNN
首先,输入nvidia-smi查看信息,但我觉得不重要
直接在终端输入以下指令,安装:
conda install cudatoolkit
conda install cudnn
应该会自己适配版本。等待安装完就行了。