Closed DanZhao1027 closed 5 years ago
This happens because either the dataset is set up improperly or some annotation is mislabeled (see #31).
Can you send over your dataset and model config objects?
Thanks a lot for your reply!
Here is my config object:
Decathlon_dataset = dataset_base.copy({ 'name': 'Dataset for Decathlon-10:Pancreas',
'train_images': '/data/pancreas/root/train',
'train_info': '/data/pancreas/root/instances_pancreas.json',
'valid_images': '/data/pancreas/root/validation',
'valid_info': '/data/pancreas/root/instances_pancreas_validation.json',
'has_gt': True,
'class_names': ('pancreas', 'tumor')
})
And here are the categories:
CATEGORIES = [ { 'id': 1, 'name': 'pancreas', 'supercategory': 'organ', }, { 'id': 2, 'name': 'tumor', 'supercategory': 'disease', } ]
I used pycococreator to create the annotation label. Here are some my annotation object:
{"annotations": [{"area": 374, "image_id": 1, "height": 512, "segmentation": [[276.0, 280.5, 271.0, 280.5, 266.5, 274.0, 267.5, 258.0, 271.0, 252.5, 283.5, 264.0, 283.5, 273.0, 276.0, 280.5]], "id": 1, "category_id": 1, "width": 512, "bbox": [267.0, 253.0, 17.0, 28.0], "iscrowd": 0}, {"area": 189, "image_id": 2, "height": 512, "segmentation": [[310.0, 257.5, 302.5, 253.0, 302.5, 245.0, 310.0, 240.5, 316.5, 244.0, 316.5, 251.0, 310.0, 257.5]], "id": 2, "category_id": 1, "width": 512, "bbox": [303.0, 241.0, 14.0, 17.0], "iscrowd": 0}}
Ok two things I can think of of the top of my head:
yolact_base_config
or whatever config you're using to train. In your case, it should be 3 (len(Decathlon_dataset.class_names) + 1
)."category_id"
in your annotations is either 1 or 2. Maybe pycococreator made a mistake in one of the annotations?Ok, thanks for your advice! I will check the code about the above two tips which is very helpful!
The problem was solved. Thanks a lot! I changed my classes in _yolact_baseconfig to _len(Decathlon_dataset.classnames) + 1 . Now it can work successfully. THX.
Hi, thanks for your work. Recently I am trying to train the net using my custom dataset. There is an issue that I find it hard to debug it by myself. Here is my problem. Thanks a lot for your help again.
[ 2] 2930 || B: 3.808 | C: 2.416 | M: 4.821 | S: 0.049 | T: 11.094 || ETA: 4 days, 14:47:05 || timer: 0.478 [ 2] 2940 || B: 3.795 | C: 2.418 | M: 4.838 | S: 0.049 | T: 11.101 || ETA: 4 days, 14:47:10 || timer: 0.497 [ 2] 2950 || B: 3.787 | C: 2.421 | M: 4.812 | S: 0.049 | T: 11.069 || ETA: 4 days, 14:49:01 || timer: 0.474 [ 2] 2960 || B: 3.778 | C: 2.422 | M: 4.846 | S: 0.049 | T: 11.095 || ETA: 4 days, 14:49:52 || timer: 0.512 [ 2] 2970 || B: 3.748 | C: 2.419 | M: 4.846 | S: 0.048 | T: 11.061 || ETA: 4 days, 14:49:04 || timer: 0.491
Computing validation mAP (this may take a while)...
Traceback (most recent call last): File "train.py", line 377, in
train()
File "train.py", line 300, in train
compute_validation_map(yolact_net, val_dataset)
File "train.py", line 370, in compute_validation_map
eval_script.evaluate(yolact_net, dataset, train_mode=True)
File "/data/pancreas/root/yolact-master/eval.py", line 869, in evaluate
prep_metrics(ap_data, preds, img, gt, gt_masks, h, w, num_crowd, dataset.ids[image_idx], detections)
File "/data/pancreas/root/yolact-master/eval.py", line 433, in prep_metrics
ap_obj = ap_data[iou_type][iouIdx][_class]
IndexError: list index out of range