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

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

Open
TigertigerTigertiger opened this issue Apr 5, 2020 · 1 comment

Comments

@TigertigerTigertiger
Copy link

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
Copy link

jpainam commented Aug 20, 2020

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?

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

2 participants