温馨提示×

Ubuntu PyTorch安装包在哪里下载

小樊
62
2025-08-28 00:47:24
栏目: 智能运维

在Ubuntu上安装PyTorch,可通过以下两种常见方式下载安装包:

  • 使用pip安装:访问PyTorch官方网站,根据系统、CUDA版本等信息生成安装命令,如在有CUDA 11.8支持的情况下,可执行命令pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118来下载安装。若无GPU,可使用pip3 install torch torchvision torchaudio命令安装CPU版本。
  • 使用conda安装:先安装Miniconda或Anaconda,然后创建虚拟环境并激活。以安装CUDA 11.8版本的PyTorch为例,可执行命令conda install pytorch torchvision torchaudio cudatoolkit=11.8 -c pytorch -c nvidia,无GPU则使用conda install pytorch torchvision torchaudio cpuonly -c pytorch命令。

0