NVlabs/DiscoBox

About Box-conditioned inference

MIYU8305 opened this issue · 1 comments

I did

bash tools/dist_test.sh
configs/discobox/boxcond_discobox_solov2_x101_dcn_fpn_3x.py
work_dirs/coco_x101_dcn_fpn_3x.pth 2
--format-only
--options "jsonfile_prefix=work_dirs/coco_x101_dcn_fpn_results.json"

I got error as below
Traceback (most recent call last):
File "tools/test.py", line 226, in
main()
File "tools/test.py", line 202, in main
outputs = single_gpu_test(model, data_loader, args.show, args.show_dir,
File "/home/user/workdir/mmdet/apis/test.py", line 30, in single_gpu_test
result = model(return_loss=False, rescale=True, **data)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py", line 42, in forward
return super().forward(*inputs, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 165, in forward
return self.module(*inputs[0], **kwargs[0])
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/mmcv/runner/fp16_utils.py", line 128, in new_func
output = old_func(*new_args, **new_kwargs)
File "/home/user/workdir/mmdet/models/detectors/single_stage_wsis.py", line 251, in forward
return self.forward_test(img, img_metas, **kwargs)
File "/home/user/workdir/mmdet/models/detectors/base.py", line 164, in forward_test
return self.simple_test(imgs[0], img_metas[0], **kwargs)
File "/home/user/workdir/mmdet/models/detectors/single_stage_wsis.py", line 262, in simple_test
results = self.bbox_head.get_seg(*seg_inputs, img=img, gt_bboxes=gt_bboxes, gt_labels=gt_labels, gt_masks=gt_masks)
TypeError: get_seg() got an unexpected keyword argument 'gt_bboxes'

How can I solve this error? If I changed
from results = self.bbox_head.get_seg(*seg_inputs, img=img, gt_bboxes=gt_bboxes, gt_labels=gt_labels, gt_masks=gt_masks)
to results = self.bbox_head.get_seg(*seg_inputs, img=img)

Error has disappeared.

Hi @MIYU8305 ,

What you did was right. Sorry, I haven't tested it very well. I will fix it later.

Thanks,

Shiyi