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

Hard-coded paadings lead to bugs when changing input image size in pytorch implementation #56

Open
JohnTargaryen opened this issue Mar 11, 2020 · 2 comments

Comments

@JohnTargaryen
Copy link

Greetings!
I change the input image size from 256,256,3 to 128,128,3, and mask size from 128,128 to 64,64 in the pytorch implementation.
However, there seem to be hard-coded padding in the network that causes bugs when changing input size.
image

image

Could you please explain what these padding operation do? And how should I modify them to adapt to my desired input sizes?

@JohnTargaryen
Copy link
Author

And I also wonder is multi-gpu training implemented in the pytorch implementation?

@shepnerd
Copy link
Owner

shepnerd commented Mar 12, 2020

The padding size calculation using dilation conv is a bit different from the common conv, and you highlighted part just hard-codes these parameters. For the detailed rules, you can refer to this post.

If you intend to process 128x128 images, you can remove the fourth dilation conv layer (with dilation=16) and its corresponding padding operation, or ensure the dilation ratio will not exceed than a specific number (refer to the padding computation in that post) and alter its corresponding padding.

For the multi-gpu training, you can use data parallel (torch.nn.DataParallel). As far as I know, current some implementations (maybe losses) are not supported in that and I will check that soon.

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