inpainting_gmcnn icon indicating copy to clipboard operation
inpainting_gmcnn copied to clipboard

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

Open JohnTargaryen opened this issue 4 years ago • 2 comments

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 avatar Mar 11 '20 02:03 JohnTargaryen

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

JohnTargaryen avatar Mar 11 '20 02:03 JohnTargaryen

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.

shepnerd avatar Mar 12 '20 09:03 shepnerd