Your code is working well. I still not understand what is the problem.
I’m just tryed to zero only the segmentation loss, and the parameters don’t updated.
Now it’s seems to me that the segmentation loss had updated the frozen parameters.
I’m checking again without zero that loss to be sure that it’s really the problem.