-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Reduce the inference cost of Faster R-CNN with FPN #952
Comments
@Jerryzcn is working on speeding up that. |
The main reason FPN is slower is actually the num of RCNN samples. FPN network uses 512, whereas non-FPN version uses 128. That being said, I have modified ROIAlign, the gain is not significant. We are working on other aspects of the model to speedup the training. We are hoping to train Mask-RCNN in 3.5 hours w/ 12 epochs schedule. |
Regarding 3., the issue is that the number of rois for each level is dynamic, so it is tricky to use assignment. |
The change for ROIAlign is in |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi, there.
In the implementation of Faster R-CNN with FPN, it takes much time in RoIPooling.
The reason is that RoIPooling computes the feature of duplicated proposals.
https://github.com/dmlc/gluon-cv/blob/master/gluoncv/model_zoo/faster_rcnn/faster_rcnn.py#L298
There are some procedures to reduce the inference cost.
Modify the implementation of RoIPooling and RoIAlign
https://github.com/apache/incubator-mxnet/blob/master/src/operator/roi_pooling.cc#L75
For invalid indexes, we should ignore its output and gradient.
Change some indexes of
rpn_rois
to-1
when they are not in the specificroi_level
RoIPooling only computes the feature of proposals, which are in the specific roi level.
Use assigment rather than sum to aggregate pooled features
pooled_roi_feats = F.ElementWiseSum(*pooled_roi_feats)
need extra addition to aggregate features.The text was updated successfully, but these errors were encountered: