When I use the nn.MSELoss(), just as follows:
nn.MSELoss(feature1, feature2)
where both the feature1 and the feature are need to be differentiated here. That means feature1 is the output of model1 and feature2 is the output of model2.
But the error is like this:
AssertionError: nn criterions don’t compute the gradient w.r.t. targets - please mark these tensors as not requiring gradients
How should I solve it?