The provided output shape of [8, 26] doesn’t match the raised error, since the class index 17 is already invalid.



 alber_mel:

This is my target model:
targets[index] 1 till targets[index] 26


Also this would indicate that you are working with 27 classes, since the target contains values in the range [0, nb_classes-1], so even if your model output is [8, 26] you will run into a new error pointing towards index 26 being out of range.