Apparently Mask head uses BCEWithLogits, so it combines sigmoid+CE, to avoid competition between masks. I get a negative value. Is this a bug, or someting’s wrong with my encoding? I encoded each target mask as a uint8 array, where all pixels are 0 except the object’s mask, which are set to the masks’s class (i.e it matches the target class).

loss_mask1717×64 19.2 KB