Ok, It’s all correct, but after this error I got last:
RuntimeError: The size of tensor a (64) must match the size of tensor b (264) at non-singleton dimension 1

I use pretrained VGG16 network as follow and my batch size is equal 64:
# Load pre-trained model, then cut off its last layer and freeze its weights
model = models.vgg16(pretrained=True)
for param in model.parameters():
    param.requires_grad = False

# Add custom fully-connected layer with 4096 neurons for the hidden layer
model.fc = nn.Linear(4096, 264).to(device)