You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Please I need help resolving issues getting an evaluation for my code. Here's the error I'm getting
from detectron2.data import DatasetCatalog, MetadataCatalog, build_detection_test_loader
from detectron2.evaluation import COCOEvaluator, inference_on_dataset
cfg.MODEL.WEIGHTS = os.path.join(cfg.OUTPUT_DIR, "model_final.pth")
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.85
predictor = DefaultPredictor(cfg)
evaluator = COCOEvaluator("category_val", cfg, False, output_dir="./output/")
val_loader = build_detection_test_loader(cfg, "category_val")
inference_on_dataset(trainer.model, val_loader, evaluator)
KeyError Traceback (most recent call last)
in <cell line: 9>()
7 evaluator = COCOEvaluator("category_val", cfg, False, output_dir="./output/")
8 val_loader = build_detection_test_loader(cfg, "category_val")
----> 9 inference_on_dataset(predictor.model, val_loader, evaluator)
1 frames
/usr/local/lib/python3.10/dist-packages/detectron2/evaluation/coco_evaluation.py in process(self, inputs, outputs)
165 """
166 for input, output in zip(inputs, outputs):
--> 167 prediction = {"image_id": input["image_id"]}
168
169 if "instances" in output:
KeyError: 'image_id'
Beta Was this translation helpful? Give feedback.
All reactions