Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 1, when using only 1 class dataset to evaluation #106

Open
YipChakwai opened this issue May 24, 2022 · 0 comments
Open

KeyError: 1, when using only 1 class dataset to evaluation #106

YipChakwai opened this issue May 24, 2022 · 0 comments

Comments

@YipChakwai
Copy link

When I use my own dataset(only 1 class) to evaluation, I got the following error. I'd appreciate it if you could guide me.

Traceback (most recent call last):
File "G:/SparseR-CNN-main/projects/SparseRCNN/train_net.py", line 176, in
launch(
File "G:\SparseR-CNN-main\detectron2\engine\launch.py", line 66, in launch
main_func(*args)
File "G:/Code+paper/SparseR-CNN-main/projects/SparseRCNN/train_net.py", line 170, in main
return trainer.train()
File "G:\SparseR-CNN-main\detectron2\engine\defaults.py", line 421, in train
super().train(self.start_iter, self.max_iter)
File "G:\SparseR-CNN-main\detectron2\engine\train_loop.py", line 144, in train
self.after_train()
File "G:\SparseR-CNN-main\detectron2\engine\train_loop.py", line 153, in after_train
h.after_train()
File "G:\SparseR-CNN-main\detectron2\engine\hooks.py", line 361, in after_train
self._do_eval()
File "G:\SparseR-CNN-main\detectron2\engine\hooks.py", line 331, in _do_eval
results = self._func()
File "G:\SparseR-CNN-main\detectron2\engine\defaults.py", line 374, in test_and_save_results
self._last_eval_results = self.test(self.cfg, self.model)
File "G:\SparseR-CNN-main\detectron2\engine\defaults.py", line 542, in test
results_i = inference_on_dataset(model, data_loader, evaluator)
File "G:\SparseR-CNN-main\detectron2\evaluation\evaluator.py", line 176, in inference_on_dataset
results = evaluator.evaluate()
File "G:\SparseR-CNN-main\detectron2\evaluation\coco_evaluation.py", line 173, in evaluate
self._eval_predictions(predictions, img_ids=img_ids)
File "G:\SparseR-CNN-main\detectron2\evaluation\coco_evaluation.py", line 212, in _eval_predictions
result["category_id"] = reverse_id_mapping[category_id]
KeyError: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant