Skip to content

huge_image_demo.py TypeError: list indices must be integers or slices, not tuple #276

@poirot0805

Description

@poirot0805

I want to run huge_image_demo.py to inference a huge image using mask_r-cnn(only for hbb detection)

cmd:

python demo/huge_image_demo.py  demo/47.jpg     workdir/mask_rcnn_x101_32x4d_fpn_mstrain-poly_3x_coco.py      workdir/epoch_12.pth

the cfg file is from mmdetection.

env: torch1.6.0 + cuda10.1 + mmcv-full1.5.0 + mmdet2.20.0

but I got this:

load checkpoint from local path: workdir/epoch_12.pth
d:\programdata\anaconda3\mmdetection\mmdet\datasets\utils.py:69: UserWarning: "ImageToTensor" pipeline is replaced by "DefaultFormatBundle" for batch inference. It is recommended to manually replace it in the test data pipeline in your config file.
  'data pipeline in your config file.', UserWarning)
<class 'list'>
Traceback (most recent call last):
  File "demo/huge_image_demo.py", line 72, in <module>
    main(args)
  File "demo/huge_image_demo.py", line 65, in main
    args.merge_iou_thr)
  File "d:\programdata\anaconda3\mmrotate\mmrotate\apis\inference.py", line 88, in inference_detector_by_patches
    results, windows[:, :2], iou_thr=merge_iou_thr, device=device)
  File "d:\programdata\anaconda3\mmrotate\mmrotate\core\patch\merge_results.py", line 26, in merge_results
    dets[:, :2] += offset
TypeError: list indices must be integers or slices, not tuple

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions