Solved by varghese_alex in post #3 
              
              
                Not sure if you are looking for this. 
pretrained_model = models.resnet18(pretrained=True) 
my_model1 = nn.Sequential(*list(pretrained_model.children())[:-1]) 
This would remove the fc layer