WXinlong / SOLO

SOLO and SOLOv2 for instance segmentation, ECCV 2020 & NeurIPS 2020.
Other
1.68k stars 306 forks source link

train your custom dataset #228

Open songyangsun opened 2 years ago

songyangsun commented 2 years ago

you can follow : https://yuanwenjie.blog.csdn.net/article/details/123592452 and https://blog.csdn.net/qq_37134388/article/details/115625744

I wanna share two things: 1.in train.py, for example, solov2_r50_fpn_8gpu_3x.py model->pretrained and load_from are different, model->pretrained is the pretrained weights of backbone, for example, resnet. url path: torchvision://resnet50. load_from is pretrained weights of SOLO, for example, SOLOv2_R50_3x.pth which can be downloaded at SOLO readme.

2.Label error. mistake is : if your class is ('A', 'B', 'C'), when you use test_ins_vis.py to get the result, you find you can get 'B' instead of 'A'(but the real label is 'A'). get 'C' instead of 'B'(but the real label is 'B'), but 'C' can't be predicted.

I use

微信截图_20220512161814

and

微信截图_20220512161854

as labels. then i get the good performance.(bbox_head->num_class=5 in train.py) if you meet this problem, you can try this.

hiiro0420 commented 2 years ago

if you get this label error, your train data may not have 'background'. you may use CLASSES = ('A','B','C') or you add 'background' class in train data.