ZhengPeng7/BiRefNet

Convolution kernal size mismatch

Closed this issue · 2 comments

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 .

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

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.