In my code, target is actually train_labels
trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
                                        download=True, transform=transform)

trainloader = torch.utils.data.DataLoader(trainset, batch_size=BATCH_SIZE,
                                          shuffle=True, num_workers=2)

criterion = nn.CrossEntropyLoss()

    for train_data, val_data in (zip(trainloader, valloader)):

        train_inputs, train_labels = train_data

        Ltrain = criterion(outputs1, train_labels)

I am a bit confused with you meant by target doesn’t contain the class indices for each pixel.
Please advise.