pytorchTutorial icon indicating copy to clipboard operation
pytorchTutorial copied to clipboard

Using BCELoss

Open hrishi483 opened this issue 2 years ago • 1 comments

hrishi483 avatar Dec 17 '23 13:12 hrishi483

I modified the given code to change the criterion = nn.CrossEntropyLoss() with criterion= BCELoss() but I get a ValueError here as ValueError: Using a target size (torch.Size([4])) that is different to the input size (torch.Size([4, 2])) is deprecated. Please ensure they have the same size. Can someone tell the reason and also provide the solution Please ??

hrishi483 avatar Dec 17 '23 13:12 hrishi483