oasjd7:

for p in network.parameters(): p.requires_grad = True


You can do that… but it’s little bit strange to split the network in two parts.
You can just run
for p in network.parameters():
    p.requires_grad = True

and use an if statement inside that for which filters those layer which you want to freeze.
if freeze p.requires_grad = False else p.requires_grad = True
(Note that the else condition is not strictly necessary if you defined them as True at the beggining)