How can I have preds returned during training

Hi everybody,
I need to implement a custom loss for torchvision faster rcnn which is a function of predictions. Is there a way to have prediction returned instead of default loss? Or differently put, is there any way to train the faster rcnn when set to eval mode?

many thanks