NielsRogge / Transformers-Tutorials

This repository contains demos I made with the Transformers library by HuggingFace.
MIT License
8.51k stars 1.34k forks source link

Error in Deformable DETR #271

Open siamakzd opened 1 year ago

siamakzd commented 1 year ago

Hi,

Thank you for the great collection of tutorials.

I am trying to fine tune Deformable DETR on a custom dataset and I modified your DETR script by modifying the model and image processors from DETR to Deformable DETR. However, I am getting this error:

File "train_deformable_detr.py", line 367, in main evaluator.update(predictions) File "/miniconda/envs/myenv/lib/python3.8/site-packages/coco_eval/coco_eval.py", line 50, in update img_ids, eval_imgs = evaluate(coco_eval) File "/miniconda/envs/myenv/lib/python3.8/site-packages/coco_eval/coco_eval.py", line 126, in evaluate self._prepare() File "/miniconda/envs/myenv/lib/python3.8/site-packages/pycocotools/cocoeval.py", line 97, in _prepare dts=self.cocoDt.loadAnns(self.cocoDt.getAnnIds(imgIds=p.imgIds, catIds=p.catIds)) File "/miniconda/envs/myenv/lib/python3.8/site-packages/pycocotools/coco.py", line 146, in getAnnIds anns = self.dataset['annotations'] KeyError: 'annotations'

My code works perfectly fine for DETR though. I think there might be some API difference between Deformable DETR and DETR image processors. I appreciate any hints. Thank you!