[Basic] TypeError: FloatClassNLLCriterion_updateOutput received an invalid combination of arguments

Hi All,

I am new here, I had an issue with Torch on my window environment.
please see below error msg and code,

If anyone has an idea what is wrong with code, please let me know

Thanks

TypeError: FloatClassNLLCriterion_updateOutput received an invalid combination of arguments - got (e[32;1minte[0m, e[32;1mtorch.FloatTensore[0m, e[31;1mtorch.IntTensore[0m, e[32;1mtorch.FloatTensore[0m, e[32;1mboole[0m, e[32;1mNoneTypee[0m, e[32;1mtorch.FloatTensore[0m, e[32;1minte[0m), but expected (int state, torch.FloatTensor input, torch.LongTensor target, torch.FloatTensor output, bool sizeAverage, [torch.FloatTensor weights or None], torch.FloatTensor total_weight, int ignore_index)

if self.use_gpu:
          feature = Variable(torch.from_numpy(feature).cuda())
          target = Variable(torch.from_numpy(target).cuda())[:, 0]
        else:
          feature = Variable(torch.from_numpy(feature))
          target = Variable(torch.from_numpy(target))[:, 0]

        # if torch.cuda.is_available():
        #   feature, target = feature.cuda(), target.cuda()
        optimizer.zero_grad() # Clears the gradients of all optimized Variable
        logit = self.model(feature)
        **_loss = F.cross_entropy(logit, target)_**

Do a search using google before posting your question. There is a handful of similar questions which have good solutions.