報錯 RuntimeError: cuda runtime error (59) : device-side assert triggered at /py/conda-bld/pytorch_...

這個在跑UCF101時候遇到了,其實(shí)報錯寫的很清楚:

libraries/torch/extra/cunn/lib/THCUNN/ClassNLLCriterion.cu:52: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [2,0,0] Assertiont >= 0 && t < n_classesfailed.

這是因?yàn)闃?biāo)簽的索引溢出了,查了一下UCF101的label是從1到101,而索引應(yīng)該是從0到100,所以把label-1就行了,so easy!

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。