RuntimeError: CUDA error: device-side assert triggered void cunn_ClassNLLCriterion_updateOutput_k

RuntimeError: CUDA error: device-side assert triggered
/opt/conda/conda-bld/pytorch_1549628766161/work/aten/src/THCUNN/ClassNLLCriterion.cu:105: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int, long) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [7,0,0] Assertion `t >= 0 && t < n_classes` failed.

使用pytorch的时候报这个错误说明你label中有些指不在[0, num classes), 区间左闭右开。比如类别数num_class=3, 你的label出现了-1或者3, 4, 5等!!!!

全部评论

相关推荐

03-05 14:55
已编辑
门头沟学院 Java
Jhin4ever:别去,杂活太多,今天让你部署一下模型,明天让你写一下LLM工作流,后天要你研究一下Agent,想微调模型都难
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务