simple-faster-rcnn-pytorch icon indicating copy to clipboard operation
simple-faster-rcnn-pytorch copied to clipboard

The problem in train on my own voc data

Open LDoubleZhi opened this issue 6 years ago • 7 comments

Hi, I use my data like voc dataset in this project.and I have met some problem. First, I replace the offical voc data(20 classes) by my own data(5 classes). and modify the VOC_BBOX_LABEL_NAMES in voc_dataset.py and vis_tool.py Then I saw self.roi_cm = ConfusionMeter(21) in line 62 in trainer.py, so I modiy it into 6. and the error occurs.---------------"AssertionError: number of predictions does not match size of confusion matrix", I guess whether I have not modiy the classes number.and I want to know where I modify it Thank you very much!

LDoubleZhi avatar Sep 10 '18 11:09 LDoubleZhi

@chenyuntc

LDoubleZhi avatar Sep 10 '18 11:09 LDoubleZhi

@mahavird

LDoubleZhi avatar Sep 10 '18 11:09 LDoubleZhi

hello! I have met the same question as yours. Have you resolved it? Can you tell me?thank you very very much!

cmstudyscode avatar Sep 26 '18 06:09 cmstudyscode

My guess is that there are some other places you might need to modify. i.e the RCNN head for final predictions (number of predictions in your error?) so it would be from https://github.com/chenyuntc/simple-faster-rcnn-pytorch/blob/0ea7069318692d6cf80c0dcbae7ed45b70cfc5e8/model/faster_rcnn_vgg16.py#L58 to 5 in your case

rxqy avatar Sep 26 '18 08:09 rxqy

now I'm using endernewton's tf-faster-rcnn..... @cmstudyscode @rxqy

LDoubleZhi avatar Sep 30 '18 07:09 LDoubleZhi

When I use my dataset train model meet same problem,my dataset have 4 category.I modify code and the problem is solved.

1.modify model/faster_rcnn_vgg16.py n_fg_class=4 2.modify trainer.py self.roi_cm = ConfusionMeter(5)

hope can help you

blackAndrechen avatar Mar 03 '20 12:03 blackAndrechen

Thank you SOOOOO MUCH. You saved me even if it's been 3 years later. @blackAndrechen

ginnj avatar Jul 31 '23 17:07 ginnj