[Edit: The original suggestion is broken, my apologies, see blow!]
Did you actually try?
Any recent version of PyTorch should give you an error 10.
You can get rid of those by using
fc_params = list(resnet18.fc.parameters())
other params = [p for p in resnet18.parameters() if p not in fc_params]

or so.
Best regards
Thomas