Skip to content

Instantly share code, notes, and snippets.

@rahulvigneswaran
Created April 16, 2022 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulvigneswaran/1422e60471f85334ed3232087cee2a63 to your computer and use it in GitHub Desktop.
Save rahulvigneswaran/1422e60471f85334ed3232087cee2a63 to your computer and use it in GitHub Desktop.
For CSEDUT
import torchvision
model_conv = torchvision.models.resnet18(pretrained=True)
for name, param in model_conv.named_parameters():
if not("fc" in name):
param.requires_grad = False
print(name, param.requires_grad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment