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博客

相关推荐
All The Way North-16 分钟前
【硬核实战】基于GRU + 注意力机制 的Seq2Seq机器翻译模型——从数据预处理到训练推理全解析
pytorch·gru·nlp·机器翻译·注意力机制·seq2seq·teacher forcing
Westward-sun.1 小时前
【Python+PyTorch】从零实现食物识别:自动生成标注 + CNN 训练全流程
pytorch·python·cnn
Dxy12393102162 小时前
PyTorch的ConstantLR详细介绍:学习率调度中的“呼吸节奏”
人工智能·pytorch·学习
好的收到1112 小时前
PyTorch深度学习(小土堆)笔记4: PyTorch 训练不再“开盲盒”,TensorBoard 可视化保姆级教程
pytorch·笔记·深度学习
红茶川3 小时前
[ExecuTorch 系列] 3. 导出自定义的大语言模型
pytorch·ai·语言模型·端侧ai
不懒不懒3 小时前
【零基础入门 PyTorch:实现食物图片分类任务】
人工智能·pytorch·python
love530love11 小时前
Windows 11 源码编译 vLLM 0.16 完全指南(RTX 3090 / CUDA 12.8 / PyTorch 2.7.1)
人工智能·pytorch·windows·python·深度学习·vllm·vs 2022
兜兜风d'12 小时前
PyTorch 深度学习实践——CNN卷积神经网络
pytorch·深度学习·cnn
心无旁骛~12 小时前
【BUG记录】解决安装PyTorch3D时出现的“No module named ‘torch‘“错误
pytorch·3d·bug
吴佳浩19 小时前
什么是算力?
人工智能·pytorch·llm