fix: compute auxiliary losses when denoising is disabled in D-FINE#45601
Conversation
|
cc @molbap @yonigozlan @NielsRogge maybe |
vasqu
left a comment
There was a problem hiding this comment.
LGTM, but can we add a small test to confirm that behavior under dfine? Would like a second opinion from @yonigozlan tho if he agrees to this as I'm not 100% familiar with this
|
Thanks for the review! That makes sense — I’ll add a small test to verify auxiliary losses are computed when num_denoising=0. |
|
CI failed due to a CircleCI authentication error (not related to the code change). Could someone please re-run the workflow? |
yonigozlan
left a comment
There was a problem hiding this comment.
Looks good to me thanks for fixing @Abineshabee !
|
[For maintainers] Suggested jobs to run (before merge) run-slow: d_fine |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Fixes #45593
Problem
When
num_denoising=0,denoising_meta_valuesisNone, causingDFineForObjectDetectionLossto skip auxiliary loss computation entirely since it is gated under the same condition.However, auxiliary losses (deep supervision across decoder layers) are independent of denoising and should still be computed when
config.auxiliary_loss=True. This leads to degraded training behavior when denoising is disabled.Fix
Decoupled denoising logic from auxiliary loss computation:
denoising_meta_valuesis notNoneconfig.auxiliary_loss=TrueThis follows the same pattern used in
loss_rt_detr.py.Testing
loss_vfl_aux_*,loss_bbox_aux_*) are present whennum_denoising=0