share the code of your model and it would be easy to debug. The problem is surely in your last fully connected layer. The size mismatch clearly says that you are getting 1000 features each for 12 images(batch size) but then you have 12 features to be compared with.
Clearly fully connected layer has the problem.
Use this and you will solve the problem-
vgg16 = models.vgg16(pretrained=True)
vgg16.classifier[6]= nn.Linear(4096, 3)
if __name__ == "__main__":
from torchsummary import summary
model = vgg16
model = model.cuda()
print(model)
summary(model, input_size = (3,120,120))
----------------------------------------------------------------
Layer (type) Output Shape Param #
================================================================
Conv2d-1 [-1, 64, 120, 120] 1,792
ReLU-2 [-1, 64, 120, 120] 0
Conv2d-3 [-1, 64, 120, 120] 36,928
ReLU-4 [-1, 64, 120, 120] 0
MaxPool2d-5 [-1, 64, 60, 60] 0
Conv2d-6 [-1, 128, 60, 60] 73,856
ReLU-7 [-1, 128, 60, 60] 0
Conv2d-8 [-1, 128, 60, 60] 147,584
ReLU-9 [-1, 128, 60, 60] 0
MaxPool2d-10 [-1, 128, 30, 30] 0
Conv2d-11 [-1, 256, 30, 30] 295,168
ReLU-12 [-1, 256, 30, 30] 0
Conv2d-13 [-1, 256, 30, 30] 590,080
ReLU-14 [-1, 256, 30, 30] 0
Conv2d-15 [-1, 256, 30, 30] 590,080
ReLU-16 [-1, 256, 30, 30] 0
MaxPool2d-17 [-1, 256, 15, 15] 0
Conv2d-18 [-1, 512, 15, 15] 1,180,160
ReLU-19 [-1, 512, 15, 15] 0
Conv2d-20 [-1, 512, 15, 15] 2,359,808
ReLU-21 [-1, 512, 15, 15] 0
Conv2d-22 [-1, 512, 15, 15] 2,359,808
ReLU-23 [-1, 512, 15, 15] 0
MaxPool2d-24 [-1, 512, 7, 7] 0
Conv2d-25 [-1, 512, 7, 7] 2,359,808
ReLU-26 [-1, 512, 7, 7] 0
Conv2d-27 [-1, 512, 7, 7] 2,359,808
ReLU-28 [-1, 512, 7, 7] 0
Conv2d-29 [-1, 512, 7, 7] 2,359,808
ReLU-30 [-1, 512, 7, 7] 0
MaxPool2d-31 [-1, 512, 3, 3] 0
AdaptiveAvgPool2d-32 [-1, 512, 7, 7] 0
Linear-33 [-1, 4096] 102,764,544
ReLU-34 [-1, 4096] 0
Dropout-35 [-1, 4096] 0
Linear-36 [-1, 4096] 16,781,312
ReLU-37 [-1, 4096] 0
Dropout-38 [-1, 4096] 0
Linear-39 [-1, 3] 12,291
================================================================
Total params: 134,272,835
Trainable params: 134,272,835
Non-trainable params: 0
----------------------------------------------------------------
Input size (MB): 0.16
Forward/backward pass size (MB): 62.84
Params size (MB): 512.21
Estimated Total Size (MB): 575.21