py-faster-rcnn icon indicating copy to clipboard operation
py-faster-rcnn copied to clipboard

No module named rpn.proposal_layer

Open hoticevijay opened this issue 8 years ago • 8 comments

I used VGG16 end2end algorithm in py-faster-rcnn to train a model. I am trying to get the test scores using the following command.

caffe test -model -weights -gpu 0 -iterations 100

I am getting the following error

I0331 07:42:46.740831 5018 layer_factory.hpp:77] Creating layer proposal ImportError: No module named rpn.proposal_layer

Caffe path is set to py-faster-rcnn's caffe path. Is there anything else I can try to get the test scores?

hoticevijay avatar Mar 31 '16 07:03 hoticevijay

Hello, I'm trying to fine-tune the VGG16.v2.caffemodel. Using the caffe-fast-rcnn version of Caffe, and faster_rcnn_test.pt for the network.

But when I run I get the same error: I0510 14:45:20.216603 16195 layer_factory.hpp:77] Creating layer proposal ImportError: No module named rpn.proposal_layer

Did you or anyone else find a solution for this error?

DiegoPortoJaccottet avatar May 10 '16 17:05 DiegoPortoJaccottet

isn't it because rpn.proposal_layer is defined only in python? I'm not sure but maybe it's because the native caffe interface cannot process Python layer?

layer { name: 'proposal' type: 'Python' <==== bottom: 'rpn_cls_prob_reshape' bottom: 'rpn_bbox_pred' bottom: 'im_info' top: 'rois' python_param { module: 'rpn.proposal_layer' <==== layer: 'ProposalLayer' param_str: "'feat_stride': 16" } }

chankim avatar Jun 09 '16 08:06 chankim

I guess, the reason is that './lib' is not in your PATH. You should use $FRCN_ROOT/tools/test_net.py to do evaluation since it will import _init_paths, which will insert './lib' into your PATH

HaozhiQi avatar Jun 09 '16 17:06 HaozhiQi

Have you solved your problem? I've faced similar error! :/

aarafati avatar Mar 07 '17 01:03 aarafati

I have the same error when I run it in cpp. I implemented a class based on https://github.com/YihangLou/FasterRCNN-Encapsulation-Cplusplus. It works perfectly running the tool/demo.py but when I run the code it throws ImportError: No module named rpn.proposal_layer. The other layers are created perfectly so It might be related with what @chankim said. It seems to be implemented only in python.

Bardo91 avatar May 08 '17 17:05 Bardo91

Hi, I'm not sure if it is related, but I had the same error trying to read a faster-rcnn network with the C++ faster-rcnn version (https://github.com/D-X-Y/caffe-faster-rcnn/tree/dev). Actually, when using the C++ version, you have to replace the python layer (cited by @chankim) in the deploy.prototxt file by :

layer {
  name: "proposal"
  type: "FrcnnProposal"
  bottom: "rpn_cls_prob_reshape"
  bottom: "rpn_bbox_pred"
  bottom: "im_info"
  top: "rois"
  top: "scores"
}

which is the c++ version of the layer. The parameters can be set in the config.json file.

RomainDWipsea avatar Jun 20 '17 12:06 RomainDWipsea

see my comment here

LucasMahieu avatar Mar 08 '18 13:03 LucasMahieu

I guess, the reason is that './lib' is not in your PATH. You should use $FRCN_ROOT/tools/test_net.py to do evaluation since it will import _init_paths, which will insert './lib' into your PATH

This is the correct answer. Just do the following:- if "/path/to/py-faster-rcnn/lib" not in sys.path: sys.path.insert(0, ""/path/to/py-faster-rcnn/lib")

jtdutta1 avatar Jun 17 '19 11:06 jtdutta1