probably this is our best bet, but I think it's more difficult than what Patrick suggests because all of the stages (rpn, roi_heads) behave the same as the "parent" network: they only return losses during training, detector_losses and proposal_losses are empty dicts if in eval mode.
Logging validation loss is trickier than expected due to the model we are using.
fasterrcnn_resnet50_fpn_v2
that returns predictions only if set to evaleager_outputs()
method of the parent classGeneralizedRCNN
?forward
method?rpn
,roi_heads
) behave the same as the "parent" network: they only return losses during training,detector_losses
andproposal_losses
are empty dicts if in eval mode.