transformers
266d3b05 - Fix UnboundLocalError in RT-DETR loss computation (#42224)

Commit
52 days ago
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 <Rocketknight1@users.noreply.github.com>
Parents
Loading