I am trying to use VGG16 as fixed feature extractor. But I get error "‘VGG’ object has no attribute ‘fc’’.
# CONVNET AS FIXED FEATURE EXTRACTOR
model_conv = torchvision.models.vgg16(pretrained=True)
for param in model_conv.parameters():
param.requires_grad = False
# Parameters of newly constructed modules have requires_grad=True by default
num_ftrs = model_conv.fc.in_features
model_conv.fc = nn.Linear(num_ftrs, 2)
model_conv = model_conv.to(device)