GeoffreyChen777/DDT

Size mismatch when swapping vgg19 for smaller models.

IsaacKam opened this issue · 2 comments

I have replaced vgg19 with vgg11 in DDT.py like this:
model = vgg11(pretrained=True)

and receive the following error when I run it:
RuntimeError: size mismatch, m1: [6 x 4608], m2: [25088 x 4096] at /Users/soumith/mc3build/conda-bld/pytorch_1549312653646/work/aten/src/TH/generic/THTensorMath.cpp:940

I was wondering how would I make it work for smaller faster models?

This error caused by the classifier in VGG:

DDT/vgg.py

Line 30 in 33efe8a

self.classifier = nn.Sequential(

DDT/vgg.py

Line 46 in 33efe8a

x = self.classifier(x)

In DDT, the classifier is useless. You can remove it.

Thank you :)