I’m using HingeEmbeddingLoss() but got this error.
Please help me. I don’t find any thing related to this error on the forum.
File "traning_horlicks.py", line 194, in <module>
    num_epochs=25)
  File "traning_horlicks.py", line 92, in train_model
    loss = criterion(outputs, labels)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/loss.py", line 228, in forward
    self.size_average)(input, target)
  File "/usr/local/lib/python2.7/dist-packages/torch/nn/_functions/loss.py", line 105, in forward
    buffer[torch.eq(target, -1.)] = 0
TypeError: torch.eq received an invalid combination of arguments - got (torch.cuda.LongTensor, float), but expected one of:
 * (torch.cuda.LongTensor tensor, int value)
      didn't match because some of the arguments have invalid types: (torch.cuda.LongTensor, float)
 * (torch.cuda.LongTensor tensor, torch.cuda.LongTensor other)
      didn't match because some of the arguments have invalid types: (torch.cuda.LongTensor, float)
 * (torch.cuda.LongTensor tensor, int value)
      didn't match because some of the arguments have invalid types: (torch.cuda.LongTensor, float)
 * (torch.cuda.LongTensor tensor, torch.cuda.LongTensor other)
      didn't match because some of the arguments have invalid types: (torch.cuda.LongTensor, float)

Thanks