How can i enuser of freezing layers?

i have a classifier model and tried to freeze some layers and need to ensure that this layers are already freeze … is there any way to know that ?

You can check the .requires_grad attribute of all parameters, which should be frozen, and make sure it’s returning False and could additionally check that their .grad attribute is None after a backward operation.

1 Like