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

Fixed an Error when training L2 and SSIM models #119

Closed
wants to merge 1 commit into from
Closed

Fixed an Error when training L2 and SSIM models #119

wants to merge 1 commit into from

Conversation

sena-nana
Copy link

I use translation software to write down the following information. If you have any questions, please point them out and I will explain them in more detail.

what I did

Fixed a BUG that caused Error when training L2 and SSIM models

the Error is

RuntimeError: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [5]

image

my env

I deployed LPIPS on the latest version of pytorch (and other packages).And I met this BUG.So I'm not sure if this BUG exists on the deployment of the original version.

how did this BUG appear

The error report occurred after the model forward function, when the value was introduced into the rank model forward function. After debug, I found that, unlike the LPIPS model, the size of the forward output Tensor of these two models is [1], not expected [1,1,1,1].

Combined with the prompt of error report, I think this should be the key to solving BUG.I reshape the Tensor and it works now.

Fixed a BUG that caused Error when training L2 and SSIM models
RuntimeError: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [5]
@sena-nana sena-nana closed this by deleting the head repository Dec 19, 2023
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

Successfully merging this pull request may close these issues.

1 participant