Thanks for the reply. When I am training my demo, I actually did not add the ‘precision’ parameter, and the total loss is the torch.mean(torch.sum(loss_1 + loss_2 + loss_3)). And the training for loss_2 still does’t work.
My code has some differences with the code in the link: Multi-Task 5. 1. My loss wrapper receives three separate inputs, and get three separate output and losses, while the model in the link shares one common input. 2. I found that loss_2 has different scale than loss_1 and loss_3, it is much smaller.
However, If the problem is 1: multi-input problem, loss_1 and loss_3 works normally; and if the problem is 2: scale problem, set loss_1 = loss_3 = 0 or simply abandon them still does not help.
I am still so confused and may need to check more details about “loss.backward()”.