Commit 266d3b0
Fix UnboundLocalError in RT-DETR loss computation (#42224)
* Fix UnboundLocalError in RT-DETR loss computation
Initialize auxiliary_outputs to None before conditional use to prevent
UnboundLocalError when config.auxiliary_loss is False.
Fixes the error:
UnboundLocalError: local variable 'auxiliary_outputs' referenced before assignment
This occurs when auxiliary_loss is disabled but the variable is still
referenced later in the function.
* Update src/transformers/loss/loss_rt_detr.py
---------
Co-authored-by: Matt <[email protected]>1 parent 8d6c458 commit 266d3b0
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| 450 | + | |
450 | 451 | | |
451 | 452 | | |
452 | 453 | | |
| |||
0 commit comments