'CocoEvaluator: [03/02 14:37:20 d2.evaluation.coco_evaluation]: Note that some metrics cannot be computed

I am trying to run inference on a trained model and want to run the cocoevaluator.

Following is the code I am running

from detectron2.evaluation import COCOEvaluator, inference_on_dataset
from detectron2.data import build_detection_test_loader
evaluator = COCOEvaluator("leukocytes_test2", cfg, False, output_dir="./output/")
val_loader = build_detection_test_loader(cfg, "leukocytes_test2")
inference_on_dataset(trainer.model, val_loader, evaluator)

I get the following warning.

[03/02 14:37:20 d2.evaluation.coco_evaluation]: Note that some metrics cannot be computed.
OrderedDict([('bbox',
              {'AP': nan,
               'AP50': nan,
               'AP75': nan,
               'APl': nan,
               'APm': nan,
               'APs': nan})])

Thought my output prediction pretty much match my labels

prediction: "bbox": [74.77423095703125, 75.0336685180664, 124.49356079101562, 126.57610321044922]
Labels: "bbox": [ 80.0, 74.0, 116.0, 131.0 ]

Can u tell me what is the error I have 9 images in my test dataset



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source