DetVisGUI icon indicating copy to clipboard operation
DetVisGUI copied to clipboard

error on custom dataset in coco format.

Open genaev opened this issue 5 years ago • 2 comments

I trained the mask_rcnn model and want to visualize the results of the test samples. My data includes two classes and I converted the data to coco format..

cmd line for DetVisGUI: python DetVisGUI/DetVisGUI.py config/mask_rcnn_r50_caffe_fpn_mstrain-poly_1x_fly.py --det_file work_dirs/mask_rcnn_r50_caffe_fpn_mstrain-poly_1x_fly/test.pkl --stage test

I get the following error:

Traceback (most recent call last):
  File "DetVisGUI/DetVisGUI.py", line 1315, in <module>
    vis_tool().run()
  File "DetVisGUI/DetVisGUI.py", line 363, in __init__
    self.info.set('DATASET: {}'.format(self.data_info.dataset))
AttributeError: 'vis_tool' object has no attribute 'data_info'

file mask_rcnn_r50_caffe_fpn_mstrain-poly_1x_fly.py:

_base_ = 'mask_rcnn/mask_rcnn_r50_caffe_fpn_mstrain-poly_1x_coco.py'

model = dict(
    roi_head=dict(
        bbox_head=dict(num_classes=2),
        mask_head=dict(num_classes=2)))

dataset_type = 'COCODataset'
classes = ('male','female',)
data = dict(
    train=dict(
        img_prefix='data/train',
        classes=classes,
        ann_file='data/train/annotations.json'),
    val=dict(
        img_prefix='data/valid',
        classes=classes,
        ann_file='data/valid/annotations.json'),
    test=dict(
        img_prefix='data/test',
        classes=classes,
        ann_file='data/test/annotations.json'))

genaev avatar Jan 15 '21 19:01 genaev

Hi, you can try to use "CocoDataset" as dataset_type instead of "COCODataset" in your config file. If there is still error, please let me know. Thanks.

Chien-Hung avatar Jan 19 '21 02:01 Chien-Hung

Hi everyone! I spend some time in this issue, because I ran into the same problem and checked ur solution Chien-Hung. In deed, this did the trick. Would it be a solution to compare the two strings like that: "DetVisGUI.py" Line 360:

if cfg.dataset_type.lower() == 'VOCDataset'.lower():
    self.data_info = VOC_dataset(cfg, self.args)
elif cfg.dataset_type.lower() == 'CocoDataset'.lower():
    self.data_info = COCO_dataset(cfg, self.args)

So the case of the word will not affect the comparing.

BTW thanks for this nice tool! It has saved me a lot of time :slightly_smiling_face:

pixx1 avatar Jan 22 '21 08:01 pixx1