I was using
for p in model.parameters():
print(p)
to keep track of parameters. However, after trained the model, the unfrozen parameter values do not change.
I was using
for p in model.parameters():
print(p)
to keep track of parameters. However, after trained the model, the unfrozen parameter values do not change.
You could check if these parameters were getting a valid gradient accumulated into their .grad
attribute after the first backward()
operation. If not, then the computation graph might have been detached.