操作方法参考网址: https://blog.csdn.net/gg864461719/article/details/112259806

pytorch官方网址: https://pytorch.org/

pytorch不是最新的版本官方网址: https://pytorch.org/get-started/previous-versions/

pytorch国内镜像网址: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/

测试安装的cuda版本torch

测试安装的cuda版本torch是否可以使用,使用以下命令测试可能会更好:

import torch
torch.zeros(1).cuda()

如果输出如下则说明可以使用cuda版本的torch:
在这里插入图片描述
如果报错是GeForce RTX 3080 with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.那么一定是cuda版本的问题了。安装cuda版本不对。

解决办法:

降低CUDA版本:

1.在运行pytorch程序的时候报这样的错:
GeForce RTX 3080 with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.
具有CUDA功能的GeForce RTX 3080 sm_86与当前Pythorch安装不兼容。当前Pythorch安装支持CUDA功能sm_37sm_50 sm_60 sm_61 sm_70 sm_75 compute_37。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐