如何安装兼容CUDA 11.7的pytorch?

问题描述 投票:0回答:1

我的机器上有“NVIDIA GeForce RTX 2070”GPU。我发现 CUDA 11.7 是与该 GPU 兼容并可与 pytorch 配合使用的最新版本 CUDA。我已经安装了 CUDA 11.7。现在我正在尝试安装与 CUDA 11.7 一起使用的 pytorch。 我试过这个: pip 安装 torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117

但我只得到cpu版本:2.3.1+cpu

我也尝试通过 conda,但这也没有帮助: conda 安装 pytorch torchvision torchaudio cudatoolkit=11.7 -c pytorch

如何获得 GPU 兼容版本?

pytorch pip conda
1个回答
0
投票

如果你有精确的版本,这对我有用: pip install torch==2.0.0+cu117 --extra-index-url https://download.pytorch.org/whl/cu117 pip install torchvision==0.15.0+cu117 --extra-index-url https://download.pytorch.org/whl/cu117

但没有检查兼容的 torchaudio 版本。

© www.soinside.com 2019 - 2024. All rights reserved.