Yes, the label seems to be a picture. You could try to visualize it using something like:
import matplotlib.pyplot as plt
plt.imshow(label[0, 0, ...].data.numpy())

When you are dealing with a multi-class problem, you could use NLLLoss or CrossEntropyLoss. Have a look at the doc 31.
Here is a small example with 22 classes and a binary example:
# Multi-class example
x = Variable(torch.randn(1, 22, 10, 10))
y = Variable(torch.LongTensor(1, 10, 10).random_(22))

criterion = nn.NLLLoss()

loss = criterion(x, y)

# Binary example
x = F.sigmoid(Variable(torch.randn(1, 1, 10, 10)))
y = Variable(torch.FloatTensor(1, 1, 10, 10).random_(2))

criterion = nn.BCELoss()

loss = criterion(x, y)