Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

Why do we need padding=100 for a filter of size 3? #40

Closed
deartonym opened this issue Jun 26, 2017 · 5 comments
Closed

Why do we need padding=100 for a filter of size 3? #40

deartonym opened this issue Jun 26, 2017 · 5 comments
Assignees
Labels

Comments

@deartonym
Copy link

As the title, in torchfcn/models/fcn32s.py we have the setting for the first conv1 layer:

nn.Conv2d(3, 64, 3, padding=100),

Why do we need a padding of side length 100 instead of 1 according to the filter size 3?

Thanks

@Viresh-R
Copy link

Viresh-R commented Jul 8, 2017

Shelhamer and Long use a padding of 100 for the first conv layer in their Caffe implementation.
https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/pascalcontext-fcn8s/train.prototxt

@wkentaro wkentaro self-assigned this Aug 2, 2017
@wkentaro
Copy link
Owner

wkentaro commented Aug 2, 2017

Thank you @Viresh-DL

@wkentaro wkentaro closed this as completed Aug 2, 2017
@weiaicunzai
Copy link

if anyone interested:

Why pad the input?: The 100 pixel input padding guarantees that the network output can be aligned to the input for any input size in the given datasets, for instance PASCAL VOC. The alignment is handled automatically by net specification and the crop layer. It is possible, though less convenient, to calculate the exact offsets necessary and do away with this amount of padding.

https://github.com/shelhamer/fcn.berkeleyvision.org

@Niloy-Chakraborty
Copy link

I have another issue. I am writing the code in keras/ tf.keras.
How can I add the padding=100, as it seems, keras has padding= same, valid

@WMF1997
Copy link

WMF1997 commented Feb 10, 2020

I have another issue. I am writing the code in keras/ tf.keras.
How can I add the padding=100, as it seems, keras has padding= same, valid

what about using tf.layers.conv2d??

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants