rbgirshick / py-faster-rcnn

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

Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python when running caffe notebook example "Multilabel classification on PASCAL using python data-layers" #138

Open HewenC opened 8 years ago

HewenC commented 8 years ago

Hi ,

I am new to Caffe. I am running caffe notebook multilabel classification example's script solver = caffe.SGDSolver(osp.join(workdir, 'solver.prototxt')) , I got the check error.

F0407 10:36:22.829390 22182 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python (known types: AbsVal, Accuracy, ArgMax, BNLL, Concat, ContrastiveLoss, Convolution, Data, Deconvolution, Dropout, DummyData, Eltwise, Embed, EuclideanLoss, Exp, Filter, Flatten, HDF5Data, HDF5Output, HingeLoss, Im2col, ImageData, InfogainLoss, InnerProduct, LRN, Log, MVN, MemoryData, MultinomialLogisticLoss, PReLU, Pooling, Power, ROIPooling, ReLU, Reduction, Reshape, SPP, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, SmoothL1Loss, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, Tile, WindowData)

I followed the suggestion from https://github.com/rbgirshick/py-faster-rcnn/issues/38, uncommenting WITH_PYTHON_LAYER := 1 in the Makefile.config, then make clean, then make to rebuild. There is no error returned from make recompiling step, but I still got layer unknown error in Python.

I also assigned $PYTHONPATH and LD_LIBRARY_PATH as following, echo $PYTHONPATH /home/sara/Documents/caffe/python :/home/sara/Documents/caffe/examples/pycaffe/layers echo $LD_LIBRARY_PATH /home/sara/Documents/caffe: /usr/local/lib

I saw some suggestions are changing $(TOOL_BINS) in makefile, but I am sure if I need to do any changes in my makefile. The $(TOOL_BINS) part in my makeifle is: $(TOOL_BINS): %.bin : %.o | $(DYNAMIC_NAME) @ echo CXX/LD -o $@ $(Q)$(CXX) $< -o $@ $(LINKFLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \ -Wl,-rpath,$(ORIGIN)/../lib

Are there any other methods to fix this issue?

seusofthd commented 8 years ago

Did you solve it? I also met this problem

aurotripathy commented 7 years ago

I ran into this as well! make pytest which has tests for the python data layer passes! So I am scratching my head, can't seem to figure it out.

If you've solved it, please respond.

zyzn commented 6 years ago

I also met this problem. Did anybody solve it? Thanks.

bednarikjan commented 5 years ago

I faced the same problem. In my case it was just a stupid mistake I made but it might help someone.

Since my code was first complaining about libcaffe.so.1.0.0 not being found (it is the the library which is placed in ~/caffe/distribute/lib after you run make all, make pycaffe, make distribute), I just manually moved it to my source files directory. But then I recompiled caffe again after setting WITH_PYTHON_LAYER := 1. Of course, I forgot to move the newly built libcaffe.so.1.0.0 to my src directory and thus the old one was being used and the same error about Python layer not being known kept occurring.