I’m guessing you meant

    criterion = nn.MSELoss()
    loss = criterion(output,target)


But now it complains again about the type, even though I still have the target.long() statement earlier

TypeError: FloatMSECriterion_updateOutput received an invalid combination of arguments - got (int, torch.FloatTensor, torch.LongTensor, torch.FloatTensor, bool), but expected (int state, torch.FloatTensor input, torch.FloatTensor target, torch.FloatTensor output, bool sizeAverage)