ZhengPeng7 / BiRefNet

[CAAI AIR'24] Bilateral Reference for High-Resolution Dichotomous Image Segmentation
https://www.birefnet.top
MIT License
1.09k stars 84 forks source link

Convolution kernal size mismatch #1

Closed rishabh063 closed 6 months ago

rishabh063 commented 6 months ago

When running images with tensor size :-torch.Size([3, 1365, 1024])

/content/BiRefNet/models/baseline.py in get_patches_batch(self, x, p) 227 for column_x in columns_x: 228 patches_x += [p.unsqueeze(0) for p in torch.split(column_x, split_size_or_sections=_size_h, dim=-2)] --> 229 patch_sample = torch.cat(patches_x, dim=1) 230 patches_batch.append(patch_sample) 231 return torch.cat(patches_batch, dim=0)

RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 86 but got size 75 for tensor number 15 in the list.

I am trying to add padding but facing issues .

rishabh063 commented 6 months ago

Found my mistake , while refracting forgot (config.size,config.size)

ZhengPeng7 commented 6 months ago

Aha, this code should work fine. But my annotations in them might be not sufficient. Please don't hesitate to leave issues or email me when you meet a trouble. I would always like to help to save your time.