Hi all,
I’m currently working on a project based on the finetuning tutorial. I have a model object the same as they have it in the tutorial.
Now, for validation purposes I need two things: first, I want the validation losses and second, I want the predictions in order to get the Mean Average Precision.
According to the docs:
"During training, the model expects both the input tensors, as well as a targets (list of dictionary), containing boxes, labels, masks. The model returns a Dict[Tensor] during training, containing the classification and regression losses for both the RPN and the R-CNN, and the mask loss.
During inference, the model requires only the input tensors, and returns the post-processed
predictions as a List[Dict[Tensor]], one for each input image. The fields of the Dict are as
follows: boxes, labels, scores, masks."
So, to get the losses we do:
losses = model(images, targets)
And to get the predictions we do:
predictions = model(images)
I need both things. Losses to measure the validation error and the predictions to measure MAP. I’d want something like:
losses, predictions = model(images, targets)
Does anyone know if it is possible with this implementation? I could get both things by just doing those two lines of code, but that means iterating through the dataset twice, something that can take a long time.