How to get validation in a pretrainied model?

Hi, I’m quite new to pytorch and am currently trying to retrain a pretrained object detection model fasterrcnn_resnet50_fpn_v2(weights=FasterRCNN_ResNet50_FPN_V2_Weights.COCO_V1)
with a custom dataset and different classes (I have changed out the last layer to only have 3 classes).

The model seems to work great after some training time and I can track the training loss from the output dict of
loss_dict = model(images, targets).
However I am now wondering how I can track the validation loss with the same loss functions used in the training process (without actually changing the weights and/or when in model.eval()). How could I achieve this?

Thanks for your help =)