Your model seems to work fine using:
model = vgg19_bn()
x = torch.randn(1, 3, 224, 224)
out = model(x)

If you are getting the shape mismatch error using:
feature_extractor = torch.nn.Sequential(*list(model_ft.classifier.children())[:-2])

then note that nn.Sequential will only use all registered modules in a sequential way and will not apply the functional calls defined in the forward method.
Also, you are currently only using the model_ft.classifier.children(), which will skip all other layers, so that your input won’t have the desired shape.
If you want to get the 4096 features from the first linear layer, you could use:
model = vgg19_bn()
model.classifier = model.classifier[0] # only use first linear layer

or alternatively you could replace the last linear layer with nn.Identity(), which would apply the additional relu, dropout and linear layer:
# alternatively
model.classifier[6] = nn.Identity() # replace last linear layer with Identity