What is the predicted output label from a PyTorch model?
I am currently training a ResNet18 model with a custom optimizer in PyTorch.
I am using CrossEntropyLoss() and the ResNet18 model from PyTorch.
In tensorflow the outputs are of the desired shape, but in pytorch it is necessary to find the argmax of the predicted labels in order to find the accuracy.
If my batch size = 64 with the resnet model, why is the predicted label of shape [64, 1000]?
What do the 1000 values correspond to?

The predicted quantity is not &quot;label&quot;, it is the probability (soft score) of the input being one of 1000 classes.
The output of (64, 1000) contains a 1000 length vector for each input in a batch. If you want discrete labels (i.e. 0 to 999), perform an argmax over it
labels = torch.argmax(output, 1)

By argmax over each probability vector, we compute which class (among 1000) has the highest probability for the input.
