Thanks for your suggestion, I checked is_leaf attribute and all of them were True, but the gradients of parameters are None, do you have any other suggestion? maybe there is a problem with my pretrained classifier or loss function?
by the way I used this code snippet for checking the leaf
for parameter in maskedlm_.parameters():
     print(parameter.data.is_leaf)