Pytorch-UNet icon indicating copy to clipboard operation
Pytorch-UNet copied to clipboard

The generated mask graph is in the shape of [h, W, 3]. Now, the following data that only supports three-dimensional data appears using celoss. Does it need to convert the three-channel graph into one channel? Finally, do a dimensionality reduction to get the shape of [n, h, w] ?

Open gittjob opened this issue 3 years ago • 8 comments

1only batches of spatial targets supported (3D tensors) but got targets of size: : [1, 254, 500, 3]

gittjob avatar Nov 08 '21 02:11 gittjob

image

gittjob avatar Nov 08 '21 02:11 gittjob

U can do some changes,including transform your masks to one-channel.

SkevyHoo avatar Nov 08 '21 10:11 SkevyHoo

ok,thank U.its good.

gittjob avatar Nov 09 '21 02:11 gittjob

@SkevyHoo i got predicted mask has shape : torch.Size([1, 2, 497, 640]) and ground true mask has shape: GT torch.Size([1, 497, 640]). I wander what the 2nd dimension in predicted mask shape stand for? Thanks

BaoanhTrinh avatar Feb 22 '22 05:02 BaoanhTrinh

@BaoanhTrinh n_classes

BEFOURD avatar Feb 25 '22 05:02 BEFOURD

ok,thank U.its good.

I also encountered this problem, did you solve it? how to solve

KaiXinZhang2000 avatar Apr 01 '22 04:04 KaiXinZhang2000

图片

你好,我也出现了这个问题,请问你这个问题解决了吗

xyx0430 avatar Jun 10 '22 04:06 xyx0430

你需要将你的true_masks转换为单通道格式 @xyx

BEFOURD avatar Jun 10 '22 13:06 BEFOURD