Lanczos code crashes
nonick2k23 opened this issue · 3 comments
nonick2k23 commented
Hi,
Using PROBA-V dataset, the code crashes in lanczos file with this error:
RuntimeError: Expected 2D (unbatched) or 3D (batched) input to conv1d, but got input of size: [1, 16, 202, 202]
Why insight on what might cause this?
milder-z commented
I encountered the same problem.
And sadly, there seems to be no pre-trained model provided here.
yunseok624 commented
Did someone solve the problem?
jakubsadel commented
I thought that here it was enough to remove the transpose, because it looked like it disturbed the dimensionality, but nevertheless it did nothing :/.
def transform(self, theta, I, device="cpu"):
'''
Shifts images I by theta with Lanczos interpolation.
Args:
theta : tensor (B, 2), translation params
I : tensor (B, C_in, H, W), input images
Returns:
out: tensor (B, C_in, W, H), shifted images
'''
self.theta = theta
new_I = lanczos.lanczos_shift(img=I.transpose(0, 1), #delate transpose
shift=self.theta.flip(-1), # (dx, dy) from register_batch -> flip
a=3, p=5)[:, None]
return new_I