I tried to write the code by referring to the Transfer Learning page on readthedocs, but I got RuntimeError: mat1 dim 1 must match mat2 dim 0.
Since the FC layer of RenNet50 is a classification of 1000 classes, I tried setting the input of self.classifier to 1000, and it worked.
I am new to machine learning, so I am not sure if this is really the right fix. Thanks!