zjhuang22 / maskscoring_rcnn

Codes for paper "Mask Scoring R-CNN".
MIT License
1.9k stars 378 forks source link

error when train and test : if 'caption' in anns[0]: IndexError: list index out of range #92

Open TigertigerTigertiger opened 4 years ago

TigertigerTigertiger commented 4 years ago

I'm training my own dataset with mask scoring rcnn. When I run with "configs/e2e_ms_rcnn_R_50_FPN_1x.yaml", error occurred. error to do with training: Traceback (most recent call last): File "tools/train_net.py", line 171, in main() File "tools/train_net.py", line 167, in main test(cfg, model, args.distributed) File "tools/train_net.py", line 104, in test maskiou_on=cfg.MODEL.MASKIOU_ON File"/home/zhhu/wjy/mask_scoring_RCNN/maskscoring_rcnn/maskrcnn_benchmark/engine/inference.py", line 430, in inference dataset.coco, coco_results[iou_type], file_path, iou_type File"/home/zhhu/wjy/mask_scoring_RCNN/maskscoring_rcnn/maskrcnn_benchmark/engine/inference.py", line 258, in evaluate_predictions_on_coco coco_dt = coco_gt.loadRes(str(json_result_file)) File "/home/zhhu/python3.6.7/lib/python3.6/site-packages/pycocotools/coco.py", line 318, in loadRes if 'caption' in anns[0]: IndexError: list index out of range error to do with testing: Traceback (most recent call last): File ''tools/test_net.py'' , line 94 , in main() File ''tools/test_net.py'', line 88,in main maskiou_on=cfg.MODEL.MASKI0U_ON File"/home/zhhu/wjy/mask_scoring_RCNN/maskscoring_rcnn/maskrcnn_benchmark/engine/inference.py", line 430, in inference dataset.coco, coco_results[iou_type], file_path, iou_type File"/home/zhhu/wjy/mask_scoring_RCNN/maskscoring_rcnn/maskrcnn_benchmark/engine/inference.py", line 258, in evaluate_predictions_on_coco coco_dt = coco_gt.loadRes(str(json_result_file)) File "/home/zhhu/python3.6.7/lib/python3.6/site-packages/pycocotools/coco.py", line 318, in loadRes if 'caption' in anns[0]: IndexError: list index out of range I have double checked my json file in "annotations", but really don't know what's wrong! Need your help! Thank you in advance!!

jpainam commented 4 years ago

Hi, please, I also have a problem testing my model. Can you show me how you run tools/test_net.py. I used python tools/test_net.py --config-file "configs/e2e_ms_rcnn_R_50_FPN_1x.yaml" command but I get an error different from yours

  File "/home/eldad/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/eldad/anaconda3/lib/python3.7/site-packages/maskrcnn_benchmark-0.1-py3.7-linux-x86_64.egg/maskrcnn_benchmark/modeling/roi_heads/maskiou_head/roi_maskiou_feature_extractors.py", line 39, in forward
    x = torch.cat((x, mask_pool), 1)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 5 and 20 in dimension 0 at /pytorch/aten/src/THC/generic/THCTensorMath.cu:83

Any idea?