torch,Enet, Assertion t >= 0 && t < n_classes failed

training on my dataSet, but there is a error, and i has checked the label. It is resized to [0, nclasses-1].

How about trying to group the conditional statements.
(t>=0) && (t<n_classes)
I think the comparison is happening as 0 && t.
With the restricted amount of information, I could think only of this.

It may be that my description is not detailed enough to cause your misunderstanding. when followed the repository(https://github.com/e-lab/ENet-training) to train my own dataset, i met a error. And i find that this error occurs in train.lua(err = loss:forward(y,yt) – updateOutput).
Here’s the error shown:
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: [1,0,0] Assertion t> = 0 && t <n_classes failed

The error still points to your targets being out of range.
I’m not that familiar with LuaTorch, but could you somehow check that the number of output predictions match the number of classes?

i has checked the target.
Here’s a part of yt:

there are just two classes.