Glad I could help! 
You cannot use that head since it has a Softmax layer.
I would recommend something like:
model.fc = nn.Sequential(nn.Linear(512, 256),
                         nn.ReLU(),
                         nn.Linear(256,num_classes),
                         nn.ReLU()
                         )

Rmember that you don’t have to add the softmax operation in your nn.Sequential since it could interfere with the softmax done on CrossEntropyLoss