sudo pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
指定版本
sudo pip3 install torch==2.1.0+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
官网找指定的下载的指令
https://pytorch.org/get-started/previous-versions/
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
参考链接:
教程(部分参考)