That 2 lines of code freezes the whole model. If you want to finetune few layers, you need to get the parameters of those layers and make the ‘requires_grad’ as True, so that you can finetune those layers.