motokimura / yolo_v1_pytorch

PyTorch implementation of YOLO-v1 including training

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

maxpool layer

HonestyBrave opened this issue · comments

Hi, motokimura,
I'm sorry, I have to ask you again, the question is about Maxpool Layer in darknet.py file of "_make_conv_layers", is about "nn.MaxPool2d(2)", the function nn.MaxPool2d(2), you didn't use the "stride" parameter, but the author paper has to stride, so i have confusion, could you give a more explain?

Uploading image.png…

thank you very much!

According to the PyTorch docs, stride default value is kernel_size.
This means, if stride is not given, stride is set to the same value as kernel_size.

https://pytorch.org/docs/1.0.0/nn.html?highlight=maxpool2d#torch.nn.MaxPool2d

So nn.MaxPool2d(2) is equivalent to nn.MaxPool2d(kernel_size=2, stride=2).

Very very thank you!