Hi,
I wanted to test other loss function for Mask R-CNN, so I followed this answer here 22.
This is what I did as a test:

I took maskrcnn_loss, changed the name, and added a print to make sure that everything was ok.
I tried to use roi_heads.mask_rcnn_loss = My_Loss

And I alsoI tried to use mymodel.roi_heads.mask_rcnn_loss = My_Loss


Unfortunately, in both case, MyLoss was never called (print never executed).
I use TorchVision 0.6.1.
What am I doing wrong?