Hello,
I am using pre-trained VGGNet-16 model where the layers skipping the FC part are wrapped in torch.nn.DataParallel.
The optimizer I used is:
optimizer = optim.SGD([{'params': model.pretrained_model[0][24].parameters()},
                           {'params': model.pretrained_model[0][26].parameters()},
                           {'params': model.pretrained_model[0][28].parameters()},
                           {'params': model.regressor[0][1].parameters()},
                           {'params': model.regressor[0][4].parameters()}], lr=0.001, momentum=0.9)

which gives me 'DataParallel' object does not support indexing TypeError.
pretrained_model contains the CONV layers only and regressor contains FC layers only.
There is no error if I use model.regressor.parameters(), but I need to update parameters in last few layers in pretrained_model also. How do I fix it?