生成 .condarc 文件,位于C:\Users\Admin\
conda config --set show_channel_urls yes
记事本打开 .condarc 文件,添加以下内容:
创建虚拟环境
conda create -n pytorch python=3.8 anaconda
进入虚拟环境
conda init cmd.exe
conda activate pytorch
在虚拟环境中安装pytorch、torchvision、cuda
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
测试
因篇幅问题不能全部显示,请点此查看更多更全内容