Open pytorch official website:
As shown above, select your own device information, and then a command will be automatically generated. Just execute this command directly in anaconda
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
if things go well:
Wait for the download, the installation is successful:
Check out the torch version;
ok,deal
ps: Some friends may download very slowly, you can go to Tsinghua mirror to download the whl file, and then pip install the whl file is also possible.