Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save n0obcoder/4e9a2a436f03cdc827788afb5da1a7c2 to your computer and use it in GitHub Desktop.

Select an option

Save n0obcoder/4e9a2a436f03cdc827788afb5da1a7c2 to your computer and use it in GitHub Desktop.
for name, param in model.named_parameters():
print(name, ':', param.requires_grad)
sequential.0.weight : False
sequential.0.bias : False
sequential.1.weight : False
sequential.1.bias : False
layer1.weight : False
layer1.bias : False
layer2.weight : False
layer2.bias : False
fc.weight : True
fc.bias : True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment