报错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标签个数超过了设定的类别数。

相关推荐
吃货界的硬件攻城狮3 小时前
【BUG】记STM32F030多通道ADC DMA读取乱序问题
stm32·嵌入式硬件·bug
星释3 小时前
Yii2项目自动向GitLab上报Bug
前端·gitlab·bug·yii
upp1 天前
【bug】Error: /undefinedfilename in (/tmp/ocrmypdf.io.9xfn1e3b/origin.pdf)
ubuntu·pdf·bug·ghostscript
杨过姑父1 天前
部署开源版禅道,修改apache端口无效解决
bug·apache·软件工程·issue
chao_7892 天前
针对“仅某个地区出现Bug”的原因分析与解决方案
测试用例·bug
帅帅哥的兜兜2 天前
Bug问题
bug
养意2 天前
git提交代码和解决冲突修复bug
git·bug
东方不败之鸭梨的测试笔记3 天前
20250605车充安服务器受木马攻击导致服务不可用
bug
Htht1113 天前
【Qt】之【Get√】【Bug】通过值捕获(或 const 引用捕获)传进 lambda,会默认复制成 const
数据库·bug
前端发现3 天前
如何用 pnpm patch 给 element-plus 打补丁修复线上 bug(以 2.4.4 修复 PR#15197 为例)
bug