Created
November 21, 2019 18:08
-
-
Save n0obcoder/2ece9300ca3f155e0723be10a81e4c95 to your computer and use it in GitHub Desktop.
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
| # We would freeze all but the last few layers (layer4 and fc) | |
| for name, param in model.named_parameters(): | |
| if ('layer4' in name) or ('fc' in name): | |
| param.requires_grad = True | |
| else: | |
| param.requires_grad = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment