RuntimeError: CUDA error: device-side assert triggeredCUDA kernel errors might be asynchronously re

我在训练IDDPM时遇到了

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.

字面翻译:

运行时错误:CUDA错误:触发了设备端断言

CUDA内核错误可能会在其他一些API调用中异步报告,因此下面的stacktrace可能不正确。

对于调试,请考虑传递CUDA_LAUNCH_BLOCKING=1。

使用“TORCH_USE_CUDA_DSA”进行编译以启用设备端断言。

把gpu换成cpu一下就找到问题了。原来是我的nn.Embedding(1000,512),嵌入只能嵌入[0,999],但是我的t随机生成[1-1000],当随机到1000时就会报错。

 在嵌入时将t-1

 成功解决问题

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值