piggyback icon indicating copy to clipboard operation
piggyback copied to clipboard

Missing average pool in modnets.vgg definition

Open ankitk28 opened this issue 5 years ago • 2 comments

I think vgg16 definition is missing average pool before classifier (I got error in weight copying step between pretrained vgg to modnets.vgg which I traced back to this )

ankitk28 avatar May 02 '19 07:05 ankitk28

Avg pool does not have any weights, so I am not sure what error you're getting. The original VGG-16 definition does not have pooling as it only expects an input of size 224 x 224. If you are going to use a larger input, then you have to introduce an adaptive pooling of size 7x7 to match the expected output size of the last conv into fc6.

arunmallya avatar Dec 10 '19 08:12 arunmallya

I guess AdaptiveAvgPool2d was not in the required versions:

torch==0.2.0.post3 torchvision==0.1.9;

it was newly added: https://github.com/pytorch/vision/pull/747

so I guess (with higher versions of pytorch) one can skip this when doing copy_.

joemzhao avatar Jan 02 '20 11:01 joemzhao