Target size (torch.Size([10])) must be the same as input size (torch.Size([2]))

Use what @theairbend3r suggested or alternatively switch to nn.CrossEntropyLoss and treat your binary classification as multi-class classification. :wink: