rbgirshick / py-faster-rcnn

Faster R-CNN (Python implementation) -- see https://github.com/ShaoqingRen/faster_rcnn for the official MATLAB version
Other
8.11k stars 4.11k forks source link

class ProposalLayer(caffe.Layer): AttributeError: 'module' object has no attribute 'Layer' #567

Open Bardo91 opened 7 years ago

Bardo91 commented 7 years ago

I implemented a class in c++ based on https://github.com/YihangLou/FasterRCNN-Encapsulation-Cplusplus. It is in https://github.com/Bardo91/frcnn_caffe

The script tool/demo.py is working perfectly but when I run the code it throws

I0508 20:25:25.407884 10605 layer_factory.hpp:77] Creating layer proposal
Traceback (most recent call last):
  File "/home/bardo91/programming/3dparty/py-faster-rcnn/lib/rpn/proposal_layer.py", line 18, in <module>
    class ProposalLayer(caffe.Layer):
AttributeError: 'module' object has no attribute 'Layer'
terminate called after throwing an instance of 'boost::python::error_already_set'

. The other layers are created perfectly but when it reaches the rpn layers it fails.

I added to the python path he lib folder in of py-caffe-rcnn as: export PYTHONPATH=/usr/local:$PYTHONPATH:/home/bardo91/programming/3dparty/py-faster-rcnn/lib. And as I said the demo script works so I assume that the library is compiled and prepared properly. Is it a limitation in c++? Should I use other models?

Yexin527 commented 5 years ago

@Bardo91 Hi, I met the same error. Situation totally the same! Did you fix this and How? Thanks in advance!