jfzhang95 / pytorch-deeplab-xception

DeepLab v3+ model in PyTorch. Support different backbones.
MIT License
2.89k stars 778 forks source link

Question about ResNet's implementation? #196

Open ZhangYuef opened 3 years ago

ZhangYuef commented 3 years ago

Thanks for sharing! I have a question here about the ResNet model structure in modeling/backbone/resnet.py hyperlink.

I found the layer4 in ResNet can be built by two methods and those two methods will be different on conv2d's dilation and padding parameters. I am wondering which one is better to use.

 self.layer4 = self._make_MG_unit(block, 512, blocks=blocks, stride=strides[3], dilation=dilations[3], BatchNorm=BatchNorm)
  # self.layer4 = self._make_layer(block, 512, layers[3], stride=strides[3], dilation=dilations[3], BatchNorm=BatchNorm)

It seems the author thinks the first one is better. Could any one help me to figure out why?

Thanks in advance.

gfotedar commented 3 years ago

It has something to do with section 3.2.1 in the original paper, MG I suspect stands for Multi-grid. However, it seems a bit different from the original as the paper mentions 7 blocks and this has 4 blocks(layers) only. So I don't fully understand.