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

[Examples] The UNet model has some bugs #1697

Closed
MrinalJain17 opened this issue May 1, 2020 · 2 comments · Fixed by #1824
Closed

[Examples] The UNet model has some bugs #1697

MrinalJain17 opened this issue May 1, 2020 · 2 comments · Fixed by #1824
Labels
bug Something isn't working example help wanted Open to be worked on

Comments

@MrinalJain17
Copy link

🐛 Bug

The UNet model definition has some bugs pertaining to bilinear interpolation.

Code sample

https://github.com/PyTorchLightning/pytorch-lightning/blob/2950f669834506f8e5845b318b0f25d52d19e331/pl_examples/models/unet.py#L35-L37

In the code above, there seems to be a typo. The bilinear flag should be passed to the function Up(). It has instead been passed to the .append() method of the list.

https://github.com/PyTorchLightning/pytorch-lightning/blob/2950f669834506f8e5845b318b0f25d52d19e331/pl_examples/models/unet.py#L101-L104

The number of channels once the input passes through either one of these layers is different. For "bilinear", the number of channels remains the same, whereas they decrease to half if a ConvTranspose2d is used. This gives an error in the network's .forward() method.

I wanted to directly use the model for some other application, but not sure how issue 2 should be solved. Maybe use a 1x1 convolution to reduce the channels to half?

@MrinalJain17 MrinalJain17 added bug Something isn't working help wanted Open to be worked on labels May 1, 2020
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2020

Hi! thanks for your contribution!, great first issue!

@Borda
Copy link
Member

Borda commented May 3, 2020

@MrinalJain17 mind draft a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working example help wanted Open to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants