Pytorch--标签不对报错

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: [1,0,0] Assertion `t >= 0 && t < n_classes` failed.

Pytorch这种报错,一般是类别标签数量写错了。

如:实际标签类别为6,Net传入的数值不对

Net(3)

你可能感兴趣的:(知识积累,Pytorch--标签不对报错)