Computer vision 掩码RCNN没有属性';类别';毫米波检测

Computer vision 掩码RCNN没有属性';类别';毫米波检测,computer-vision,Computer Vision,我正在使用我的肋骨数据训练MMD检测的掩模rcnn模型。 模型完成了训练,但当我尝试进行推理并可视化输出时,我得到了一个错误,即mask rcnn没有属性类 cfg = Config.fromfile('/content/mmdetection/configs/mask_rcnn/mask_rcnn_r101_fpn_2x_coco.py') cfg.dataset_type = 'CocoDataset' cfg.classes = ("article","fla

我正在使用我的肋骨数据训练MMD检测的掩模rcnn模型。 模型完成了训练,但当我尝试进行推理并可视化输出时,我得到了一个错误,即mask rcnn没有属性类

cfg = Config.fromfile('/content/mmdetection/configs/mask_rcnn/mask_rcnn_r101_fpn_2x_coco.py')
cfg.dataset_type = 'CocoDataset'
cfg.classes = ("article","flag","footer")
cfg.data.train.img_prefix = '/content/drive/MyDrive/training_dataset_1/'
cfg.data.train.classes = cfg.classes
cfg.data.train.ann_file = '/content/drive/MyDrive/training_dataset_1/training_data.json'
cfg.data.train.type = 'CocoDataset'
cfg.data.val.img_prefix = '/content/vgg/'
cfg.data.val.classes = cfg.classes
cfg.data.val.ann_file = '/content/vgg/arabic_newspaper_coco.json'
cfg.data.val.type = 'CocoDataset'
cfg.data.test.img_prefix = '/content/drive/MyDrive/validation (1)'
cfg.data.test.classes = cfg.classes
cfg.data.test.ann_file = '/content/drive/MyDrive/validation (1)/validation_data.json'
cfg.data.test.type = 'CocoDataset'
cfg.optimizer.lr = 0.02 / 8
cfg.lr_config.warmup = None
cfg.log_config.interval = 500

Change the evaluation metric since we use customized dataset.
cfg.evaluation.metric = 'mAP'

#We can set the evaluation interval to reduce the evaluation times
cfg.evaluation.interval = 3

#We can set the checkpoint saving interval to reduce the storage cost
cfg.checkpoint_config.interval = 3

Set seed thus the results are more reproducible
cfg.seed = 0
set_random_seed(0, deterministic=False)
cfg.gpu_ids = range(1)

cfg.load_from = 'checkpoints/mask_rcnn_r101_fpn_2x_coco_bbox_mAP-0.408__segm_mAP- 
0.366_20200505_071027-14b391c7.pth'
cfg.work_dir = "/content/output"
cfg.runner.max_epochs = 1
cfg.total_epochs = 1
model = build_detector(cfg.model)
mmcv.mkdir_or_exist(osp.abspath(cfg.work_dir))
datasets = [build_dataset(cfg.data.train)]
train_detector(model, datasets[0], cfg, distributed=False, validate=True)
from mmdet.apis import inference_detector, show_result_pyplot
img = mmcv.imread('/content/0001.jpg')

model.cfg = cfg
result = inference_detector(model, img)
show_result_pyplot(model, img, result,score_thr=0.5)`

错误在show_result_pyplot(模型、img、结果、得分_thr=0.5)级别上。

您能添加您得到的具体错误吗?