自学内容网 自学内容网

pytorch版本和cuda版本不匹配问题

🌕问题:Python11.8安装pytorch11.3失败

🌕CUDA版本和pytorch版本的关系

+-------+-----------------------------------------+
| CUDA  |       Supported PyTorch Versions        |
+-------+-----------------------------------------+
| 11.8  | 2.0.0                                   |
| 11.7  | 2.0.0, 1.13.1, 1.13.0                   |
| 11.6  | 1.13.1, 1.13.0, 1.12.1, 1.12.0          |
| 11.3  | 1.12.0, 1.12.1, 1.11.0, 1.10.1, 1.10.0, |
|       | 1.9.1, 1.9.0, 1.8.1                     |
| 11.1  | 1.10.0, 1.9.1, 1.9.0, 1.8.2, 1.8.1,     |    
|       | 1.8.0                                   |
| 11.0  | 1.7.1, 1.7.0                            |
| 10.2  | 1.12.0, 1.12.1, 1.11.0, 1.10.1, 1.10.0, |
|       | 1.9.1,1.9.0, 1.8.2, 1.8.1, 1.8.0, 1.7.1,|
|       | 1.7.0, 1.6.0, 1.5.1, 1.5.0              |
| 10.1  | 1.8.1, 1.7.1, 1.7.0, 1.6.0, 1.5.1,      |
|       | 1.5.0, 1.4.0                            |
| 10.0  | 1.2.0, 1.1.0, 1.0.1, 1.0.0              |
| 9.2   | 1.7.1, 1.7.0, 1.6.0, 1.5.1, 1.5.0,      |
|       | 1.4.0, 1.2.0                            |
| 9.0   | 1.1.0, 1.0.1, 1.0.0                     |
| 8.0   | 1.0.0                                   |
+-------+-----------------------------------------+

发现cuda11.8支持pytorch2.0.0

🌕安装Pytorch2.0.0

官网:https://pytorch.org/get-started/previous-versions/

🌙pip方法

# CUDA 11.8
pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118

在这里插入图片描述
安装成功。

🌙cuda方法

# CUDA 11.8
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia

原文地址:https://blog.csdn.net/qq_42864343/article/details/142722301

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!