I have a dataset whose labels are of shape [torch.FloatTensor of size 316x2] for a one hot encoding with 2 classes. My neural network has output layer of 2 neurons. When I tried to use criterion = nn.CrossEntropyLoss() I get this error Expected object of type Variable[torch.LongTensor] but found type Variable[torch.FloatTensor] for argument #1 ‘target’
How can I fix this thanks.