有英伟达新卡的安装
cuda与硬件驱动兼容对比
https://mp.weixin.qq.com/s/2B6CCjeJ0S8hZc3MtaojTA
pytorch-cuda=12.1 与 https://download.pytorch.org/whl/cu121是相同的作用
GPU
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
其中cu118是cuda的版本
阿里源 https://mirrors.aliyun.com/pytorch-wheels/cu121/
https://data.pyg.org/whl/ 好多的torch包
一条命令可以安装pytorch GPU 、cudatoolkit(省去了手动下载好几个G的繁琐)
conda install pytorch-cuda=<CUDA_VERSION> torchvision cudatoolkit=<CUDA_VERSION> -c pytorch
互换
conda install pytorch-cuda=11.8 torchvision torchaudio -c pytorch 与pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu118
可以互换但是推荐用conda
一条命令搞定所有的英伟达GPU环境
conda install pytorch-cuda=11.8 torchvision torchaudio cudnn -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
官网
https://download.pytorch.org/whl/
CPU
pip install numpy --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu