facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
29.32k stars 7.32k forks source link

Split forward pass and loss calculation during training #5179

Open mwindsp opened 6 months ago

mwindsp commented 6 months ago

In the current implementation, the forward pass and loss calculation during training is done in one step. Both input and ground truth data are fed into the model.

In certain scenarios, it is however useful to split this into two distinct steps. E.g. I would like to calculate the loss twice using different ground truth data, which currently requires to perform the actual forward pass twice resulting in unnecessary computations.

Therefore, it would be beneficial, if the framework supports to split both steps.

Programmer-RD-AI commented 1 month ago

Hi, Is there anything supporting this that shows this will increase performance or provide any sort of benefit? And could you elaborate on how this would work..? Thank you