I use this script 185 to finetune inception_v3 model on a custom dataset. The script already supports AlexNet and VGGNet. However, when finetune with pretrained inception_v3 model, there is an error:

python main.py 9 -a inception_v3 -b 16 --lr 0.01 --pretrained data
=> using pre-trained model 'inception_v3’
Traceback (most recent call last):
File “main.py 9”, line 352, in 
main()
File “main.py 9”, line 194, in main
train(train_loader, model, criterion, optimizer, epoch)
File “main.py 9”, line 231, in train
output = model(input_var)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 206, in call
result = self.forward(*input, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/parallel/data_parallel.py”, line 59, in forward
return self.module(*inputs[0], **kwargs[0])
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 206, in call
result = self.forward(*input, **kwargs)
File “main.py 9”, line 104, in forward
f = self.features(x)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 206, in call
result = self.forward(*input, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/container.py”, line 64, in forward
input = module(input)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 206, in call
result = self.forward(*input, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/torchvision/models/inception.py”, line 311, in forward
x = self.fc(x)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py”, line 206, in call
result = self.forward(*input, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/torch/nn/modules/linear.py”, line 54, in forward
return self._backend.Linear()(input, self.weight, self.bias)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/functions/linear.py", line 10, in forward
output.addmm(0, 1, input, weight.t())
RuntimeError: size mismatch at /b/wheel/pytorch-src/torch/lib/THC/generic/THCTensorMathBlas.cu:243

Has anyone finetuned inception_v3 successfully?