Skip to content

A question about requires_grad in your example "7 - ResNet - Dogs vs Cats.ipynb" #1

@jizhihang

Description

@jizhihang

Hi, I'm new to learning pytorch. In "7 - ResNet - Dogs vs Cats.ipynb", there is a sentence "for param in model.parameters():
param.requires_grad = False", why did you do it ? What does it mean?
And, as far as I know, When the backward() need to be called, the state of the paramters must be requires_grad = True. I dont find where you restore this setting. Sorry for my English.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions