How to modify the final FC layer based on the torch.model

I ran into the same problem. I cloned the latest code repos of pytorch and pytorchvision and built both manually.
Or you can refer to this issue