Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lanczos code crashes #15

Open
nonick2k23 opened this issue Feb 12, 2023 · 3 comments
Open

Lanczos code crashes #15

nonick2k23 opened this issue Feb 12, 2023 · 3 comments

Comments

@nonick2k23
Copy link

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
Copy link

I encountered the same problem.
And sadly, there seems to be no pre-trained model provided here.

@yunseok624
Copy link

Did someone solve the problem?

@jakubsadel
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants