Hi, Doing Background Removal With U2net.
The error i’m getting is :
Using a target size (torch.Size([5, 3, 320, 320])) that is different to the input size (torch.Size([5, 1, 320, 320])) is deprecated. Please ensure they have the same size.
As you may know, This is a Segmentation Type task. so, it has RGB Image as X and Ground Truth Grayscale Image as Y.
The error is when i apply this model output to Loss Function. I’m Using BCE Loss.
What should i do? i don’t want to debug that error by just converting input image to Grayscale.
is there any other way ?
Thanks in advance.
your input size is
(5,1,320,320) the model is expecting to have
If you don’t want to pass RGB images
you can change
if you are using a linear layer you can change
Hope this helps
With best regards,
And also I have seen this more in BCELoss (In my personal Projects)
I am not sure if it has anything to do with BCELoss.
Thanks for your reply.
What you have said make sense in spite of the model but the problem was in processing the image Data. I could have explained that extensively.
Again, Thanks for the reply.