Created
April 16, 2022 12:23
-
-
Save rahulvigneswaran/1422e60471f85334ed3232087cee2a63 to your computer and use it in GitHub Desktop.
For CSEDUT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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