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

相关推荐
学历真的很重要7 小时前
PyTorch 机器学习工作流程基础 - 完整教程
人工智能·pytorch·后端·python·深度学习·机器学习·面试
nwsuaf_huasir13 小时前
深度学习2-PyTorch基础-张量
人工智能·pytorch·深度学习
西猫雷婶14 小时前
CNN计算|矩阵扩充方法变化和卷积核移动步长变化
人工智能·pytorch·深度学习·神经网络·矩阵·cnn
Hcoco_me15 小时前
大模型面试题12:Torch的基本操作
pytorch·深度学习·pandas
水木姚姚17 小时前
PyTorch在Microsft windows 11下的使用
人工智能·pytorch·windows
deephub17 小时前
PyTorch推理扩展实战:用Ray Data轻松实现多机多卡并行
人工智能·pytorch·python·深度学习
natide17 小时前
RuntimeError: CUDA error: device-side assert triggered
pytorch·深度学习
盼小辉丶18 小时前
PyTorch实战(15)——基于Transformer的文本生成技术
pytorch·深度学习·transformer·文本生成
Francek Chen19 小时前
【自然语言处理】预训练10:预训练BERT
人工智能·pytorch·深度学习·自然语言处理·bert
xwill*1 天前
分词器(Tokenizer)-sentencepiece(把训练语料中的字符自动组合成一个最优的子词(subword)集合。)
开发语言·pytorch·python