hi
Could you help me how to use vgg16 pretrained for 7 classes in pytorch please? I write code like follow, but I received an error like that
" RuntimeError: size mismatch at c:\anaconda2\conda-bld\pytorch_1519496000060\work\torch\lib\thc\generic/THCTensorMathBlas.cu:247"
dset_classes_number = 7
model = models.vgg16(pretrained=True)
model.classifier  = nn.Sequential(
nn.Dropout(),
nn.Linear(256 * 6 * 6, 4096),
nn.ReLU(inplace=True),
nn.Dropout(),
nn.Linear(4096, 4096),
nn.ReLU(inplace=True),
nn.Linear(4096, dset_classes_number),
)
criterion = nn.CrossEntropyLoss()
lr = 0.0002
optimizer = optim.Adam(model.parameters(), lr=0.0002)
scheduler = optim.lr_scheduler.StepLR(optimizer, step_size=2, gamma=0.95)