In that case @crowsonkb’s suggestion should work fine:
model = models.vgg19()
num_ftrs = model.classifier[-1].in_features
model.classifier[-1] = nn.Linear(num_ftrs, 7)

x = torch.randn(1, 3, 44, 44)
output = model(x)
print(output.shape)
> torch.Size([1, 7])