fast-rcnn icon indicating copy to clipboard operation
fast-rcnn copied to clipboard

How to use negative examples when training

Open zeyuanxy opened this issue 9 years ago • 6 comments

Hi, I tried training on INRIA Person, but it does not contain annotation files for negative examples, thus I just set the objs in _load_pascal_annotation to be empty? Is that okay? Thanks!

zeyuanxy avatar May 20 '15 06:05 zeyuanxy

Hi @zeyuanxy, thanks a lot for your very helpful INRIA example and your detailed recipe. I now can learn on positive examples (i.e. having images with annotations of bboxes and classes), but I am still failing to include negative examples (i.e. when there are no annotations). How have you managed to include those when learning INRIA? Setting the objs in _load_pascal_annotation to be empty as you suggest / ask results in python variables boxes, gt_classes etc to be arrays of shape (0,4) which gives problems when later in create_roidb_from_box_list the overlaps are calculated between those arrays and region proposals from selective search. What am I missing? Thanks so much!

revilokeb avatar Jun 11 '15 21:06 revilokeb

Hi @revilokeb , I am sorry that I did not include negative examples because I do not know how to make it and that was why I made this issue. Maybe @rbgirshick will help me and you.

zeyuanxy avatar Jun 12 '15 13:06 zeyuanxy

Hi. Is there an update on this? I understood that F-R-CNN picked negative examples from the selective search boxes that have overlap with the ground-truth smaller than the threshold specified in the F-R-CNN config. Is that correct?

LarsHH avatar Sep 02 '15 18:09 LarsHH

I also had such a problem. I have spent a long time to change a few codes in the lib/dataset/*.py to distinguish if there exist ground-truth boxes or not. But still got wrong in /lib/roi_data_layer/minibatch.py, it seems I need do more changes. It is very frunstrating ...... @rbgirshick

hongpingcai avatar Oct 13 '15 15:10 hongpingcai

I have the same questions. I also change some code in the lib/dataset, and when the image is a negative sample, I just put the RoIs form the selective search included in the roidb. But when I start to train, it will aborted (core dumped), and the information is "F0326 10:14:48.913087 3132 roi_pooling_layer.cu:91] Check failed: error == cudaSuccess (9 vs. 0) invalid configuration argument"

DebangLi avatar Mar 26 '16 14:03 DebangLi

Please see https://github.com/rbgirshick/fast-rcnn/pull/102

NB by default none of the ROIs in negative image will be used, however you can set TRAIN.BG_THRESH_LO to 0.0.

nwestlake avatar Mar 31 '16 15:03 nwestlake