Just wanted to point out an obvious (possibly!) anomaly in your code:
You are creating new layers (probs_tune_head, valuehead) in the forward() method of ResNet.
If you want to optimize the parameters, create the layers in __init__() method and use the created variables in forward() function.