Solved by ptrblck in post #6 
              
              
                Yes, this would create an indexing error. 
Also note that you are apparently dealing with 52 labels, which doesn’t fit the model output shape. 
In any case remap the target indices to the expected range in [0, nb_classes-1].