Pyramid-Attention-Networks-pytorch icon indicating copy to clipboard operation
Pyramid-Attention-Networks-pytorch copied to clipboard

predict mask only 1/4 of original image

Open sparkfax opened this issue 5 years ago • 0 comments

image size(3,512,512) mask_pred = self.mask_classifier(out_ss)
print(mask_pred.shape) #torch.Size([16, 5, 128, 128]) target mask 512, predict mask ony 128

self.gau_block1 = GAU(channels_blocks[0], channels_blocks[1], upsample=False) self.gau_block2 = GAU(channels_blocks[1], channels_blocks[2]) self.gau_block3 = GAU(channels_blocks[2], channels_blocks[3])

torch.Size([16, 2048, 32, 32]) False True torch.Size([16, 512, 64, 64]) True torch.Size([16, 256, 128, 128]) torch.Size([16, 5, 128, 128])

/opt/conda/lib/python3.6/site-packages/catalyst/dl/utils/criterion/dice.py in dice(outputs, targets, eps, threshold, activation) 30 outputs = (outputs > threshold).float() 31 ---> 32 intersection = torch.sum(targets * outputs) 33 union = torch.sum(targets) + torch.sum(outputs) 34 dice = 2 * intersection / (union + eps)

RuntimeError: The size of tensor a (512) must match the size of tensor b (128) at non-singleton dimension 3

sparkfax avatar Oct 29 '19 10:10 sparkfax