报错For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

.报错For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

/aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: 29,0,0, thread: 707,0,0 Assertion t >= 0 && t < n_classes failed.

报错信息如下:

./aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: 29,0,0, thread: 707,0,0 Assertion t >= 0 && t < n_classes failed.

。。。。。。

。。。。。。

RuntimeError: CUDA error: device-side assert triggered

CUDA kernel errors might be asynchronously reported at some other API call, so

the stacktrace below might be incorrect.

For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

模型运行训练,可到epoch=9 ,报错

删除models/__pycache__下的缓存文件,重新运行数据集,还是会报错。

解决方案:

是标签有问题,有一张图片标签坏了,某张图片的label标签个数超过了设定的类别数。

相关推荐
sg_knight20 小时前
ZCode Bug 定位实战:把报错丢给 ZCode,它是怎么修的
llm·bug·agent·ai编程·glm·智谱·zcode
轩轶子2 天前
Python CLI Todo:一次数据结构错误引发的 Bug
数据结构·python·bug
鬼手点金2 天前
Claude Code示范案例-修复 Bug 工作流
java·服务器·前端·javascript·bug·openclaw
^Rocky11 天前
IT 疑难杂症诊疗室:复杂技术问题解决实录
运维·bug
Keven_1113 天前
Bug:UVA816
bug
Keven_1113 天前
Bug:UVA1103
bug
钱栈up14 天前
坯料管理导入功能bug修复:只改前端一个文件就解决问题
前端·bug
项目管理实用笔记14 天前
Bug跟踪管理系统有哪些?2026 推荐清单与选型指南
bug·研发管理·研发管理工具·项目管理软件选型
iNeuOS工业互联网17 天前
iNeuOS工业互联网操作系统,重要更新:性能优化、安全漏洞与BUG修复,远程控制响应效率大幅提升
性能优化·bug
嵌入式学习菌18 天前
Modbus‑RTU 数据类型分析
开发语言·单片机·bug