Hello. I have a problem when training CNN.
I use one-hot encoding for classes (I want to have probabilities for each class). My dataset is 256x256 RGB images and batch size is 4, so inputs size is (4, 3, 256, 256). I have 120 classes, so labels size is (4, 120) and outputs size is (4, 120) too. Shapes indeed are correct.
Here is how I train my network:
criterion = nn.CrossEntropyLoss()
optimizer = optim.SGD(model.parameters(), lr=1e-4, momentum=0.9)

running_loss = 0.0

for i, data in enumerate(loader, 0):
    # get the inputs
    labels, inputs, filename = data

    # wrap them in Variable
    inputs, labels = Variable(inputs.cuda()), Variable(labels.cuda())

    # zero the parameter gradients
    optimizer.zero_grad()

    # forward + backward + optimize
    outputs = model(inputs)
    print(inputs.size(), labels.size(), outputs.size())

    loss = criterion(outputs, labels)
    loss.backward()
    optimizer.step()

    # print statistics
    running_loss += loss.data[0]

Shapes are correct, but I get error RuntimeError: multi-target not supported at /pytorch/torch/lib/THCUNN/generic/ClassNLLCriterion.cu:19 at line loss = criterion(outputs, labels).
What am I doing wrong?
Thank you very much in advance!