pytorch常见错误

pytorch常见错误

  • [1 RuntimeError: CUDA error: no kernel image is available for execution on the device。](#1 RuntimeError: CUDA error: no kernel image is available for execution on the device。)

1 RuntimeError: CUDA error: no kernel image is available for execution on the device。

报错信息:安装带gpu的pytorch的时候,

(1)先警告

NVIDIA GeForce RTX 3090 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_70 sm_75.

If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

(2)紧接着报错执行深度学习代码报错:

RuntimeError: CUDA error: no kernel image is available for execution on the device。

原因: 是因为pytorch1.6的版本不支持gpu硬件RTX 3090,需要下载更高版本的pytorch才行。

解决: 下载1.8以上版本的pytorch,算力要支持

cpp 复制代码
// 查看包支持的算力
 import torch
 torch.cuda.is_available()
// 上面返回true
 torch.cuda.get_arch_list()

torch与gpu硬件对应:

幸福的烦恼:显卡算力太高而pytorch版本太低不支持_cuda版本太高 pytorch不支持_是Yu欸的博客-CSDN博客

相关推荐
liuyunshengsir11 小时前
PyTorch 动态量化(Dynamic Quantization)
人工智能·pytorch·python
心中有国也有家17 小时前
pytorch-adapter:让 PyTorch 模型“无缝”跑在昇腾 NPU 上
人工智能·pytorch·笔记·python·学习
MediaTea19 小时前
DL:卷积神经网络的基本原理与 PyTorch 实现
人工智能·pytorch·深度学习·神经网络·cnn
xingyuzhisuan20 小时前
2026实测:租用RTX 4090 CUDA适配与PyTorch精准安装教程
人工智能·pytorch·python·深度学习·gpu算力
落日屿星辰20 小时前
PyTorch 模型迁移到昇腾NPU 完整指南
人工智能·pytorch·python
山屿落星辰21 小时前
cann-tools - 昇腾CANN 工具集使用指南
人工智能·pytorch·python
fantasy_arch1 天前
pytorch人脸匹配模型
人工智能·pytorch·python
liuyunshengsir2 天前
PyTorch 最小模型转 ONNX 完整样例
人工智能·pytorch·python
松☆2 天前
torchair:昇腾PyTorch适配层生态协作深度解读
人工智能·pytorch·python
malog_2 天前
PyTorch图像数据加载实战指南
图像处理·人工智能·pytorch·python