Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement R-FCN with py-faster-rcnn #9

Closed
argman opened this issue Jul 21, 2016 · 55 comments
Closed

implement R-FCN with py-faster-rcnn #9

argman opened this issue Jul 21, 2016 · 55 comments

Comments

@argman
Copy link

argman commented Jul 21, 2016

Hi, I'm trying to implement R-FCN in py-faster-rcnn, but encounter serval issues,
I make these changes with py-faster-rcnn:

  1. As smoothL1Loss in R-FCN is different with py-faster-rcnn, so i set the py-faster-rcnn loss as a new type of loss.
  2. move PSROIPooling and BoxAnnotatorOHEM to py-faster-rcnn
    And changes with R-FCN:
  3. change rfcn_bbox output channel to 42149=4116 since fasterrcnn use a class specific bbox regresison

Now I am able to re-compie caffe and train rpn net, but when traing fast-rcnn, I got a bug:

I0721 12:24:04.370088 12785 layer_factory.hpp:77] Creating layer per_roi_loss_cls
I0721 12:24:04.370101 12785 net.cpp:106] Creating Layer per_roi_loss_cls
I0721 12:24:04.370105 12785 net.cpp:454] per_roi_loss_cls <- cls_score_ave_cls_score_rois_0_split_0
I0721 12:24:04.370110 12785 net.cpp:454] per_roi_loss_cls <- labels_data_2_split_0
I0721 12:24:04.370113 12785 net.cpp:411] per_roi_loss_cls -> temp_loss_cls
I0721 12:24:04.370120 12785 net.cpp:411] per_roi_loss_cls -> temp_prob_cls
I0721 12:24:04.370124 12785 net.cpp:411] per_roi_loss_cls -> per_roi_loss_cls
I0721 12:24:04.370139 12785 layer_factory.hpp:77] Creating layer per_roi_loss_cls
I0721 12:24:04.370525 12785 net.cpp:150] Setting up per_roi_loss_cls
I0721 12:24:04.370537 12785 net.cpp:157] Top shape: (1)
I0721 12:24:04.370553 12785 net.cpp:157] Top shape: 1 21 1 1 (21)
I0721 12:24:04.370556 12785 net.cpp:157] Top shape: 1 (1)
I0721 12:24:04.370559 12785 net.cpp:165] Memory required for data: 678497932
I0721 12:24:04.370563 12785 layer_factory.hpp:77] Creating layer per_roi_loss_bbox
I0721 12:24:04.370575 12785 net.cpp:106] Creating Layer per_roi_loss_bbox
I0721 12:24:04.370579 12785 net.cpp:454] per_roi_loss_bbox <- bbox_pred_ave_bbox_pred_rois_0_split_0
I0721 12:24:04.370584 12785 net.cpp:454] per_roi_loss_bbox <- bbox_targets_data_3_split_0
I0721 12:24:04.370589 12785 net.cpp:454] per_roi_loss_bbox <- bbox_inside_weights_data_4_split_0
I0721 12:24:04.370595 12785 net.cpp:411] per_roi_loss_bbox -> temp_loss_bbox
I0721 12:24:04.370601 12785 net.cpp:411] per_roi_loss_bbox -> per_roi_loss_bbox
I0721 12:24:04.370652 12785 net.cpp:150] Setting up per_roi_loss_bbox
I0721 12:24:04.370658 12785 net.cpp:157] Top shape: (1)
I0721 12:24:04.370662 12785 net.cpp:157] Top shape: 1 1 1 1 (1)
I0721 12:24:04.370664 12785 net.cpp:165] Memory required for data: 678497940
I0721 12:24:04.370667 12785 layer_factory.hpp:77] Creating layer per_roi_loss
I0721 12:24:04.370679 12785 net.cpp:106] Creating Layer per_roi_loss
I0721 12:24:04.370682 12785 net.cpp:454] per_roi_loss <- per_roi_loss_cls
I0721 12:24:04.370688 12785 net.cpp:454] per_roi_loss <- per_roi_loss_bbox
I0721 12:24:04.370692 12785 net.cpp:411] per_roi_loss -> per_roi_loss
F0721 12:24:04.370698 12785 eltwise_layer.cpp:34] Check failed: bottom[i]->shape() == bottom[0]->shape() 1 0 0 0
*** Check failure stack trace: ***

thanks for you help!

@daijifeng001
Copy link
Owner

Hi, thanks for your effort. The problem seems to be from OHEM implementation. I suggest you try R-FCN without OHEM first, then carefully add OHEM training.

@daijifeng001
Copy link
Owner

Did you modify softmax_loss_layer? An additional output should be added to it, so as to get the classification loss.

@argman
Copy link
Author

argman commented Jul 21, 2016

Yes, I have already change softmax_loss_layer the same as your file.

I fix this by change roi_data_layer/layer.py line 128 to top[idx].reshape(1, 1, 1, 1),
but now i am running into other issues, seems the same problem with softmaxwithloss

0721 18:01:12.584405 31924 softmax_loss_layer.cpp:49] Check failed: outer_num_ * inner_num_ == bottom[1]->count() (1 vs. 4004)

I changed roi_data_layer/minibatch.py line 77 to:

# blobs['rois'] = rois_blob
# blobs['labels'] = labels_blob
blobs['rois'] = rois_blob.transpose(1, 0).reshape((1, 1, 5, -1))
blobs['labels'] = labels_blob.reshape((1, 1, 1, -1))
if cfg.TRAIN.BBOX_REG:
     # blobs['bbox_targets'] = bbox_targets_blob
     # blobs['bbox_inside_weights'] = bbox_inside_blob
     # blobs['bbox_outside_weights'] = \
     #     np.array(bbox_inside_blob > 0).astype(np.float32)
     blobs['bbox_targets'] = bbox_targets_blob.transpose(1, 0).reshape((1, 1, 4 * num_classes, -1))
     blobs['bbox_inside_weights'] = bbox_inside_blob.transpose(1, 0).reshape((1, 1, 4 * num_classes, -1))
     blobs['bbox_outside_weights'] = \
                np.array(bbox_inside_blob > 0).astype(np.float32).transpose(1, 0).reshape((1, 1, 4* num_classes, -1))

according to your matlab code, now the shape of my label is (1, 1, 1, N), but I dont know the shape of cls_score

@daijifeng001
Copy link
Owner

Hi,

Please consider trying R-FCN without OHEM first.

From: argman [mailto:notifications@github.com]
Sent: Thursday, July 21, 2016 6:28 PM
To: daijifeng001/R-FCN R-FCN@noreply.github.com
Cc: Jifeng Dai daijifeng001@gmail.com; Comment comment@noreply.github.com
Subject: Re: [daijifeng001/R-FCN] implement R-FCN with py-faster-rcnn (#9)

I fix this by change roi_data_layer/layer.py line 128 to top[idx].reshape(1, 1, 1, 1),
but now i am running into other issues, seems the same problem with softmaxwithloss

0721 18:01:12.584405 31924 softmax_loss_layer.cpp:49] Check failed: outer_num_ * inner_num_ == bottom[1]->count() (1 vs. 4004)

I changed roi_data_layer/minibatch.py line 77 to:

blobs['rois'] = rois_blob

# blobs['labels'] = labels_blob
blobs['rois'] = rois_blob.transpose(1, 0).reshape((1, 1, 5, -1))
blobs['labels'] = labels_blob.reshape((1, 1, 1, -1))

if cfg.TRAIN.BBOX_REG:
    # blobs['bbox_targets'] = bbox_targets_blob
    # blobs['bbox_inside_weights'] = bbox_inside_blob
    # blobs['bbox_outside_weights'] = \
    #     np.array(bbox_inside_blob > 0).astype(np.float32)
    blobs['bbox_targets'] = bbox_targets_blob.transpose(1, 0).reshape((1, 1, 4 * num_classes, -1))
    blobs['bbox_inside_weights'] = bbox_inside_blob.transpose(1, 0).reshape((1, 1, 4 * num_classes, -1))
    blobs['bbox_outside_weights'] = \
        np.array(bbox_inside_blob > 0).astype(np.float32).transpose(1, 0).reshape((1, 1, 4* num_classes, -1))

according to your matlab code, now the shape of my label is (1, 1, 1, N), but I dont know the shape of cls_score


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #9 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AH9IlVdQCnBhJFI_p5r7r3Z8ygf7p_VHks5qX0nKgaJpZM4JRb91 . https://github.com/notifications/beacon/AH9IlWH7H8jheUQV0wM_xQVIOLef7JiUks5qX0nKgaJpZM4JRb91.gif

@argman
Copy link
Author

argman commented Jul 21, 2016

Hi, Daiji, Now I am able to run the whole 4 stage model(I just try a quick run and test there is any bugs, now the model is still running).
In my quick test, I use ZF5 net, the time for one image is about 0.08s, and the original faster rcnn takes about 0.089s, is this normal? Maybe this is because I use class-specific bbox regression?

And can you share your training log on pascal_voc(much appreciated), Thanks for your help!

@daijifeng001
Copy link
Owner

Hi,

I am not sure. But in ZF, there is a large fc layer, which would be converted into a large conv layer in R-FCN. Thus the computation is heavy. I suggest you to experiment with ResNet. We have shared the step-wise training log, but do not store the joint training log.

From: argman [mailto:notifications@github.com]
Sent: Friday, July 22, 2016 12:21 AM
To: daijifeng001/R-FCN R-FCN@noreply.github.com
Cc: Jifeng Dai daijifeng001@gmail.com; Comment comment@noreply.github.com
Subject: Re: [daijifeng001/R-FCN] implement R-FCN with py-faster-rcnn (#9)

Hi, Daiji, Now I am able to run the whole 4 stage model(I just try a quick run and test there is any bugs, now the model is still running).
In my quick test, I use ZF5 net, the time for one image is about 0.08s, and the original faster rcnn takes about 0.089s, is this normal? Maybe this is because I use class-specific bbox regression?

And can you share your training log on pascal_voc(much appreciated), Thanks for your help!


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #9 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AH9Ildc1AUw1i4oB4cbzq7H5HKNaIyVCks5qX5xxgaJpZM4JRb91 . https://github.com/notifications/beacon/AH9IlTS31L6t0unRGu_g8oNU_Ynugsg1ks5qX5xxgaJpZM4JRb91.gif

@argman
Copy link
Author

argman commented Jul 22, 2016

I have tried reset50, the timeis about 0.466s, really much faster with RFCN(0.166s),
I use ZF5's conv5 to generate roi and connect your conv_new_1 to conv5, there isn't fc layers.
And I wonder if there is any other method to get the detection faster, if the base network(zf5, resnet50 etc.) doesnot take too much time and now with RFCN the prediction is much faster, maybe we should implement this in pure c++?

BTW seems some information of your email mess your reply.

@kaishijeng
Copy link

argman

I guess that you have a python script based on py-faster-rcnn to run prediction. Are you OK to share your changes?

Thanks,

@daijifeng001
Copy link
Owner

argman,

Glad to see that. Yes, you can minimize the other time cost by implementing a pure C++-based detection code. But I think that should be final step before say applying R-FCN in products.

@argman
Copy link
Author

argman commented Jul 22, 2016

@kaishijeng it's not a single script, you need to make a bit modify to other files.

@daijifeng001 during my training, I can see the region proposal time is about 0.08s/img, so seems the main cost is region proposal, the scoring time is much less, as I say resnet50 in faster rcnn is 0.466s which include region proposal time, and RFCN 0.166s/img is without region proposal, so maybe the speedup is not that great.

@daijifeng001
Copy link
Owner

daijifeng001 commented Jul 23, 2016 via email

@argman
Copy link
Author

argman commented Jul 25, 2016

@daijifeng001 , agree , but I dont see a c++ rpn layer in your code? do you know there is c++ implemention of rpn?

@argman
Copy link
Author

argman commented Jul 25, 2016

And in psroi_pooling_layer.cu, line 43, you have
Dtype roi_end_w = static_cast(round(bottom_rois[3]) + 1.) * spatial_scale;
Dtype roi_end_h = static_cast(round(bottom_rois[4]) + 1.) * spatial_scale;

but in py-fasterrcnn's roi_pooling_layer, bottom_rois[3] does not add 1, can you explain this?

@daijifeng001
Copy link
Owner

We have an internal C++ implementation. It requires some careful implementation, but not quite hard.

For roi_end_w and roi_end_h in psroi_pooling_layer and roi_pooling_layer, they are just different understanding about the ending location of ROIs and differ by 1 pixel. You may just ignore it.

@argman
Copy link
Author

argman commented Jul 25, 2016

but the 1 pixel seems important, with your original implemention, the result bbox seems totally wrong.
why do you add 1 pixel to roi, should roi be (xmin, ymin, xmax, ymax), if 1 pixel added, it turns to be (xmin, ymin, xmax+1, ymax+1).

the height and weight of the roi, in your imp is
Dtype roi_width = max(roi_end_w - roi_start_w, 0.1); //avoid 0
Dtype roi_height = max(roi_end_h - roi_start_h, 0.1);
should it be max(roi_end_w - roi_start_w + 1.0, 1.0)?

or maybe you have some preprocess somewhere I ignored.

And do you have plan to open source the rpn layer?

@daijifeng001
Copy link
Owner

We just use the exact RPN implementation in Matlab version of Faster-RCNN. We run 4-step and joint training of RPN and R-FCN for feature sharing. Everything is fine in our experiments.

@argman
Copy link
Author

argman commented Jul 25, 2016

@argman
Copy link
Author

argman commented Jul 26, 2016

I cannot find where is wrong, here is the log. it seems ok.

faster_rcnn_alt_opt_ZF_.txt

@daijifeng001
Copy link
Owner

Hi argman, we cannot locate your problem. You may carefully check and compare the intermediate results of the python and the matlab code. To the best of our knowledge, there are some researchers/groups who have successfully implement R-FCN in python.

@argman
Copy link
Author

argman commented Jul 27, 2016

@daijifeng001 I want to confirm, if batch_size=128 and two images each batch, the labels shape is 128_1_1_1, and each row is a number as 0~20, tha bbox_targets shape is 128_8_1_1, each row is [0, 0, 0, 0, 1.2, -0.75, 1.0, 0.55], the bbox_loss_weights is 128_8_1*1, each row is [0, 0, 0, 0, 1, 1, ,1 ,1] for positive and [0, 0, 0, 0, 0, 0, 0, 0] for negative
seems the bbox_pred of my model is totally wrong, one of my bbox pred is [0.07, 0.06, 0.21, -0.12, 1.15, -0.20, -0.20, 0.55], the first 4 dimension should be 0 but its not.

@daijifeng001
Copy link
Owner

Hi argman, the first 4 dimension of bbox_pred should be zero. There should be some bugs in your code.

@argman
Copy link
Author

argman commented Jul 27, 2016

I have checked my input, really dont know why.I've sent you an email. Can we talk in wechat? Tks!

@argman
Copy link
Author

argman commented Jul 28, 2016

@daijifeng001 Finally I'm able to run R-FCN with python successfully! Thanks for you help!

For others want to implement this, I have some tips here:

  • You may try R-FCN withou OHEM(I will update my result if I sucessfully run it)
  • the loss layer of R-FCN(smoothL1Loss) is a bit different with FasterRCNN(will refer to FRCNN), you can add it as a new layer in caffe(it's convenient to do this, you can google it).
  • R-FCN need rois as input, so we connect an rpn layer to generate rois, but causion here.
    • you need to modify roi_data_layer/minibatch .py to reshape rois(N511), labels(N111), bbox_targets(N811). and as R-FCN doesnot use bbox_outside_weights, you may just use bbox_inside weights(N811).
    • when doing snapshot, in FRCNN, it saves the rois' mean and std to bbox_pred layer, but in R-FCN its rfcn_bbox layer, you should modify the python snapshot code
  • In your prototxt, when doing training, for example when training the R-FCN part, you should add rpn part layer to your pt file to save the weights of rpn.
  • And some other changes to caffe and test code.The main part should be the above.

@argman
Copy link
Author

argman commented Jul 28, 2016

@daijifeng001 My test with ZF+R-FCN, the mAP on pascal_voc_test is only 35.9 with 0.053s/img, but with ZF+FRCN it's 59.3 with 0.073s/img

Maybe some threshhold is different, can you explain the difference of testing between R-FCN and FRCNN?

@ngaloppo
Copy link

ngaloppo commented Aug 1, 2016

@argman This is incredibly interesting work. Are you able to share your work, for example as a fork of py-faster-rcnn?

@argman
Copy link
Author

argman commented Aug 2, 2016

@ngaloppo I cannot reach the author's accuary so far, and still debugging..

@daijifeng001 Have you tried end2end training?

@daijifeng001
Copy link
Owner

I have tried joint training of RPN and R-FCN using ResNet 101. Its accuracy is on par with multi-step training without OHEM.

@argman
Copy link
Author

argman commented Aug 2, 2016

@daijifeng001 tks, I tried end2end training, but the bbox_pred seems to learn nothing, do you have some experience of this?

And its strange that when I use your matlab code to train resnet50, it takes about 4GB gpu memory, but when I use python code, it takes about 8GB gpu memory.

train

@argman
Copy link
Author

argman commented Aug 3, 2016

It seems ZF5-net is not appropriate to RFCN, only one layer can be tuned with bbox regression , ResNet50 is much better, because we have conv5* to finetune, with resnet50 end2end training, 07trainval->07test can get a mAP of 67.90(0.175s/img).
And end2end training is much faster than 4-stage training.

During my experiment, there maybe a better network structure for object detection and now most paper use VGG

@weiyichang
Copy link

weiyichang commented Aug 6, 2016

Hi,
I have tried to implement R-FCN with py-faster-rcnn (end2end, without OHEM) by following argman's tips. But the results for predicting bbox are not very well, and I have a question about the roi-data layer:
How to set the num_classes of python_param in roi-data layer ?
If I set it as 21 (for VOC data), the shape of bbox_targets would be wrong.
If I set it as 2, should I modify the proposal_target_layer.py ?

@argman
Copy link
Author

argman commented Aug 8, 2016

@weiyichang , in roi_data layer, its still 21, because if you use rpn to generate proposal, it's bbox regression is not class-agonostic

for bbox prediction, you should check fast_rcnn/train.py snapshot, FRCNN save the bbox mean and std in the convolution paras, you should modify it.

@xchani
Copy link

xchani commented Aug 23, 2016

@argman Hi, could you explain how to reshape rois, labels, bbox_targets and bbox_inside_weights?

@argman
Copy link
Author

argman commented Aug 24, 2016

@xchani , you may change blobs['rois'] = rois_blob to blobs['rois'] = rois_blob.reshape((-1, 5, 1, 1)) in minibatch.py and the same to lables, bbox_targets and bbox_inside_weights.

@duanLH
Copy link

duanLH commented Aug 24, 2016

@argman It's success now?

@argman
Copy link
Author

argman commented Aug 24, 2016

@duanLH ,yes, both 4 stage training and end2end works, but i cannot reproduce the mAP in the paper.

@duanLH
Copy link

duanLH commented Aug 24, 2016

@argman Wow, can you send me the py version? the Matlab version is wrong in my computer

@argman
Copy link
Author

argman commented Aug 24, 2016

@duanLH sorry I cannot right now, but if you have any questions, i'd like to help

@duanLH
Copy link

duanLH commented Aug 24, 2016

@argman OK ~thanks,

@xchani
Copy link

xchani commented Aug 25, 2016

@argman if you set `num_classes' as 21, the size of bbox_targets would be (N, 84, 1, 1). How is that possible to reshape it to (-1, 8, 1, 1) ?

@argman
Copy link
Author

argman commented Aug 25, 2016

@xchani the paper use class-agnostic bbox regression ,so its 8

@duanLH
Copy link

duanLH commented Aug 30, 2016

@argman I add the box_annotator_ohem_layer.cu box_annotator_ohem_layer.cpp to faster rcnn/src/layers
when I compile it says:
NVCC src/caffe/util/math_functions.cu
src/caffe/layers/box_annotator_ohem_layer.cu(51): warning: lambda expressions are a C++11 feature

src/caffe/layers/box_annotator_ohem_layer.cu(50): error: a template argument may not reference a local type
detected during instantiation of "void caffe::BoxAnnotatorOHEMLayer::Forward_gpu(const std::vectorcaffe::Blob<Dtype *, std::allocatorcaffe::Blob<Dtype *>> &, const std::vectorcaffe::Blob<Dtype *, std::allocatorcaffe::Blob<Dtype *>> &) [with Dtype=float]"
(77): here

src/caffe/layers/box_annotator_ohem_layer.cu(50): error: a template argument may not reference a local type
detected during instantiation of "void caffe::BoxAnnotatorOHEMLayer::Forward_gpu(const std::vectorcaffe::Blob<Dtype *, std::allocatorcaffe::Blob<Dtype *>> &, const std::vectorcaffe::Blob<Dtype *, std::allocatorcaffe::Blob<Dtype *>> &) [with Dtype=double]"
(77): here

2 errors detected in the compilation of "/tmp/tmpxft_0000576e_00000000-16_box_annotator_ohem_layer.compute_50.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/box_annotator_ohem_layer.o] Error 1
make: *** Waiting for unfinished jobs....
Did you see the same problem?

@HaozhiQi
Copy link
Collaborator

@duanLH box_annotator_ohem_layer uses C++11 features, you need to make changes to the makefile according to this commit.

@duanLH
Copy link

duanLH commented Aug 30, 2016

@oh233 thank you ~

@xchani
Copy link

xchani commented Aug 30, 2016

@argman Is there any way to save 'bbox_pred' ? I have no idea which file to modify.

@argman
Copy link
Author

argman commented Aug 30, 2016

@xchani ,its the output of the network, why do you need to save it?

@xchani
Copy link

xchani commented Aug 30, 2016

@argman I mean when doing snapshot, the rois' mean and std is not saved to bbox_pred layer

@argman
Copy link
Author

argman commented Aug 30, 2016

@xchani , its most the same as py-frcnn, anyway here is mine:

def snapshot(self):
        """Take a snapshot of the network after unnormalizing the learned
        bounding-box regression weights. This enables easy use at test-time.
        """
        net = self.solver.net

        # scale_bbox_params = (cfg.TRAIN.BBOX_REG and
        #                      cfg.TRAIN.BBOX_NORMALIZE_TARGETS and
        #                      net.params.has_key('bbox_pred'))
        scale_bbox_params = (cfg.TRAIN.BBOX_REG and
                             cfg.TRAIN.BBOX_NORMALIZE_TARGETS and
                             net.params.has_key('rfcn_bbox'))

        if scale_bbox_params:
            # save original values
            orig_0 = net.params['rfcn_bbox'][0].data.copy()
            orig_1 = net.params['rfcn_bbox'][1].data.copy()

            rep_time = orig_0.shape[0]/self.bbox_means.shape[0]
            bbox_stds = self.bbox_stds.flatten().reshape((-1, 1))
            bbox_stds = np.tile(bbox_stds, rep_time)
            bbox_stds = bbox_stds.flatten().reshape((-1, 1, 1, 1))

            bbox_means = self.bbox_means.flatten().reshape((-1, 1))
            bbox_means = np.tile(bbox_means, rep_time)
            bbox_means = bbox_means.flatten().reshape((-1, 1, 1, 1))

            # scale and shift with bbox reg unnormalization; then save snapshot
            net.params['rfcn_bbox'][0].data[...] = \
                (net.params['rfcn_bbox'][0].data * bbox_stds)
            net.params['rfcn_bbox'][1].data[...] = \
                (net.params['rfcn_bbox'][1].data * bbox_stds.flatten() + bbox_means.flatten())

        infix = ('_' + cfg.TRAIN.SNAPSHOT_INFIX
                 if cfg.TRAIN.SNAPSHOT_INFIX != '' else '')
        filename = (self.solver_param.snapshot_prefix + infix +
                    '_iter_{:d}'.format(self.solver.iter) + '.caffemodel')
        filename = os.path.join(self.output_dir, filename)

        net.save(str(filename))
        print 'Wrote snapshot to: {:s}'.format(filename)

        if scale_bbox_params:
            # restore net to original state
            net.params['rfcn_bbox'][0].data[...] = orig_0
            net.params['rfcn_bbox'][1].data[...] = orig_1
        return filename

@zimenglan-sysu-512
Copy link

@argman thanks for your efforts. i try ohem with resnet50 in end2end style on 07+12 trainval, achieve 76.91% mAP on 07 testset.

@argman
Copy link
Author

argman commented Sep 4, 2016

@zimenglan-sysu-512 , thats great! so ohem is really helpful!

@ngaloppo
Copy link

ngaloppo commented Sep 7, 2016

@argman Since you have been able to reproduce the paper's results, are you able to share your python implementation?

@YuwenXiong
Copy link
Contributor

Hi @ngaloppo , I've released my py-R-FCN code, you can try it :).

@ngaloppo
Copy link

@orpine Super! I will have a look. Thanks for the heads-up!

@daijifeng001
Copy link
Owner

Given @orpine 's nice work, we close this issue.

@whuhxb
Copy link

whuhxb commented Jun 19, 2017

@duanLH Have you solved this problem? The makefile of mine is correct, but still has the problem. I have no idea how to solve this problem. Could you please tell me?
I add the box_annotator_ohem_layer.cu box_annotator_ohem_layer.cpp to faster rcnn/src/layers
when I compile it says:
NVCC src/caffe/util/math_functions.cu
src/caffe/layers/box_annotator_ohem_layer.cu(51): warning: lambda expressions are a C++11 feature

src/caffe/layers/box_annotator_ohem_layer.cu(50): error: a template argument may not reference a local type
detected during instantiation of "void caffe::BoxAnnotatorOHEMLayer::Forward_gpu(const std::vectorcaffe::Blob<Dtype *, std::allocatorcaffe::Blob<Dtype *>> &, const std::vectorcaffe::Blob<Dtype *, std::allocatorcaffe::Blob<Dtype *>> &) [with Dtype=float]"
(77): here

src/caffe/layers/box_annotator_ohem_layer.cu(50): error: a template argument may not reference a local type
detected during instantiation of "void caffe::BoxAnnotatorOHEMLayer::Forward_gpu(const std::vectorcaffe::Blob<Dtype *, std::allocatorcaffe::Blob<Dtype *>> &, const std::vectorcaffe::Blob<Dtype *, std::allocatorcaffe::Blob<Dtype *>> &) [with Dtype=double]"
(77): here

2 errors detected in the compilation of "/tmp/tmpxft_0000576e_00000000-16_box_annotator_ohem_layer.compute_50.cpp1.ii".
make: *** [.build_release/cuda/src/caffe/layers/box_annotator_ohem_layer.o] Error 1
make: *** Waiting for unfinished jobs....

@csnemes2
Copy link

csnemes2 commented Sep 26, 2017

@whuhxb (as @duanLH already suggested) add "-std=c++11" to CXX flags!
compilation error will disappear, I confirm

how to do that?
not the best but for a quick hack: put this in CMakeLists.txt
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
then
build$ cmake .. (this will display your configuration anyway where you can inspect your CXX flags)
build$ make all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests