autonomousvision / transfuser

[PAMI'23] TransFuser: Imitation with Transformer-Based Sensor Fusion for Autonomous Driving; [CVPR'21] Multi-Modal Fusion Transformer for End-to-End Autonomous Driving
MIT License
1.04k stars 175 forks source link

Accessing the gradient of the transfuser model in evaluation mode #227

Open MCUBE-2023 opened 2 days ago

MCUBE-2023 commented 2 days ago

Hi,

Would please tell me which part of the code allows me to access the gradient of the transfuser model in evaluation mode ?

Thank you bunches in advance :)

Kait0 commented 1 day ago

If you mean gradients during deployment, than you need to look at the run_step function. Gradient computation is disabled by default to improve efficiency, you need to remove the inference_mode() and no_grad() decorators.