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

Can we change the U-net to fit any size of the input image? #32

Closed
j96w opened this issue Sep 26, 2018 · 2 comments
Closed

Can we change the U-net to fit any size of the input image? #32

j96w opened this issue Sep 26, 2018 · 2 comments

Comments

@j96w
Copy link

j96w commented Sep 26, 2018

I tried to input the U-net with different size of the input image. It seems that sometimes when the size number is odd, it will lead to some problem when we upsample, especially when we concat different Xi(x, x1, x2, x3, x4, x5). Is there some way we can change the U-net to fit any size of the input image? Thankyou.

@milesial
Copy link
Owner

Yes I know about this issue, I mention it in the README. It seems to me that there should be no problem when upsampling thanks to the padding, that cause the two sizes to match up in order to concat. But I think my padding implementation (https://github.com/milesial/Pytorch-UNet/blob/master/unet/unet_parts.py#L66) may be wrong.

Check out the forks (https://github.com/milesial/Pytorch-UNet/network), some people have modified this part of the code, but I have not tested it.

More specifically https://github.com/HaiyongJiang/U-Net-Pytorch-Unstructured-Buggy/commit/0e854509c2cea854e247a9c615f175f76fbb2e3a

@j96w
Copy link
Author

j96w commented Sep 26, 2018

Ya, after deleting one of the ')' and switch diffX and diffY in HaiyongJiang's code. Everything works well. Thank you.

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

2 participants