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

Assert at least one proposal for inference #170

Open
beacandler opened this issue Jan 14, 2018 · 0 comments
Open

Assert at least one proposal for inference #170

beacandler opened this issue Jan 14, 2018 · 0 comments

Comments

@beacandler
Copy link

beacandler commented Jan 14, 2018

problem

I encountered a problem when using the trained faster_rcnn model to inference a image:
roi_pooling_layer.cu:91 Check failed: error == cudaSuccess(9 vs. 0) invalid configuration arguments

reason

I found that the reason is that when the input image is too small (such as(10,10)), faster_rcnn will resize the image to (720, 720).
when inferencing, this image will be passed to proposal_layer.py,but there is no one roi at all.
then crashed .

code

1.roi_pooling layer calls CAFFE_GET_BLOCKS(N)
$CAFFE_ROOT/src/caffe/layers/roi_pooling_layer.cu 84:15
ROIPoolForward<Dtype><<<CAFFE_GET_BLOCKS(count), CAFFE_CUDA_NUM_THREADS>>>( count, bottom_data, spatial_scale_, channels_, height_, width_, pooled_height_, pooled_width_, bottom_rois, top_data, argmax_data);
2.roi_pooling layer will crash when call CAFFE_GET_BLOCKS(0):
in $CAFFE_ROOT/include/caffe/util/device_alternate.hpp 88:43
inline int CAFFE_GET_BLOCKS(const int N) { return (N + CAFFE_CUDA_NUM_THREADS - 1) / CAFFE_CUDA_NUM_THREADS; }
then the CUDA_POST_KERNEL_CHECK will throw error, then crashed.

solution

  1. Assert N > 0, when calls CAFFE_GET_BLOCKS(N)
    return std::max(1, (N + CAFFE_CUDA_NUM_THREADS - 1) / CAFFE_CUDA_NUM_THREADS);
    but this method is not proposed.
  2. Assert at least one proposal for inference
    modify $FASTER_RCNN_ROOT/lib/rpn/proposal_layer.py 150 - ,
    when len(keep) == 0
    if len(keep) == 0: keep = [0]
    this method is proposed.
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

1 participant