kazuto1011 / deeplab-pytorch

PyTorch re-implementation of DeepLab v2 on COCO-Stuff / PASCAL VOC datasets
MIT License
1.09k stars 282 forks source link

Why do you set ceil_mode=True in the _Stem class of the file resnet.py? #80

Closed cnyanhao closed 4 years ago

cnyanhao commented 4 years ago

Thank you for your legible and powerful code! I've noticed that you set ceil_mode=True in the _Stem class of the file resnet.py, here. This will change the size of the output feature. I've noticed that the implementation of torchvision didn't use that, here. Do you have any special consideration to add this? Thank you so much.

kazuto1011 commented 4 years ago

My ResNet modules are defined to match the original DeepLab v2 written in Caffe to load a pre-trained caffemodel. The "ceil" pooling is from here in the authors' Caffe. The bottleneck block is also different from the one in torchvision, on whether the strided-downsampling is in the 1st 1x1 or 2nd 3x3 convolution.