Got empty prediction result

Hey guys. I am currently training a FCOS model with pytorch; yet, when I try one batch before training. I got an empty prediction as followed {'boxes': tensor([], size=(0, 4)), 'scores': tensor([]), 'labels': tensor([], dtype=torch.int64)}
I set the num_cls to my desired number, 11. And it works fine if I’m using default weights.

I’m grateful for any comments. thanks.

This might be expected if no valid objects are found, e.g. if the model wasn’t trained at all and uses random parameters or if random noise if feed into a segmentation model as seen for MaskRCNN:

model = torchvision.models.detection.maskrcnn_resnet50_fpn(weights=torchvision.models.detection.MaskRCNN_ResNet50_FPN_Weights.DEFAULT)
model.eval()
x = [torch.rand(3, 300, 400), torch.rand(3, 500, 400)]
predictions = model(x)
print(predictions)
# [{'boxes': tensor([], size=(0, 4), grad_fn=<StackBackward0>), 'labels': tensor([], dtype=torch.int64), 'scores': tensor([], grad_fn=<IndexBackward0>), 'masks': tensor([], size=(0, 1, 300, 400))}, {'boxes': tensor([], size=(0, 4), grad_fn=<StackBackward0>), 'labels': tensor([], dtype=torch.int64), 'scores': tensor([], grad_fn=<IndexBackward0>), 'masks': tensor([], size=(0, 1, 500, 400))}]

Hey, thanks a lot for replying!
It makes sense if i hadn’t trained the model and then got empty results. But, after I trained the model with my dataset and the training seemed fine I still got empty results after evaled on val dataset.