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

相关推荐
抽象具象化30 分钟前
BUG日志:使用热点或免费加速器时git链接github出现端口22拒绝访问的解决方法
git·github·bug
北珣.7 小时前
测试的BUG分析
bug
shanks6619 小时前
【Bug】natten:安装报错(临近注意力机制的高效cuda内核实现)
bug
shenmu841 天前
脚本无法获取响应主体(原因:CORS Missing Allow Credentials)
django·bug
怀旧单机1 天前
咸鱼之王+手游开服搭建架设+内购修复无bug运营版
bug
筱歌儿1 天前
uniapp 阿里云点播 播放bug
uni-app·bug
励碼2 天前
BUG: 解决新版本SpringBoot3.4.3在创建项目时勾选lombok但无法使用的问题
java·spring boot·bug·lombok
烽火聊员2 天前
bug exposed beyond app through Intent.getData()
android·bug
yngsqq3 天前
NTS库学习,找bug中......
java·学习·bug
数学人学c语言3 天前
记录torch运行的bug
python·深度学习·bug