Closed aquibjaved closed 4 years ago
You should make pycaffe
Hi @yanxp while installing I've made pycaffe. But this is in another folder do I need to build caffe in the folder below
RCN_ROOT/caffe-fast-rcnn
# Now follow the Caffe installation instructions here:
# http://caffe.berkeleyvision.org/installation.html
# If you're experienced with Caffe and have all of the requirements installed
# and your Makefile.config in place, then simply do:
make -j8 && make pycaffe
Maybe you should do ;
export CAFFE_ROOT=/home/USERNAME/py-faster-rcnn/caffe-fast-rcnn
Note that you should change username properly!
Hi @eonurk Thank you for replying I hit the command
export CAFFE_ROOT=/home/aquib/py-faster-rcnn/caffe-fast-rcnn
What this error mean?
hi, aquibjaved, I met the same problem as you did, do you hav solved it?:)
Hi @TJUNatsume, No I didn't get any solution. I don't why no one is replying to this error I m still stuck at this point I also tried in another laptop I installed everything from beginning and again stuck here.
@aquibjaved have you export PYTHONPATH=/path/caffe/python:$PYTHONPATH?maybe it helps.
Hi @aquibjaved and @TJUNatsume , did you guys got this issue resolved? I am also facing the same issue. In my case, error is
Traceback (most recent call last):
File "demo.py", line 18, in
Hi, @aseem3213 No, the problem is not solved yet, and I also stopped trying it. What I found is, Caffe module need Cuda to run, I am using AMD system with Radeon Graphics card. CUDA only support Nvidea graphics card for gpu usage.
Did you guys do "make py" after making the caffe? Also check that if you installed prerequisites completely. In addition to that, you dont have to work with your GPU. Go to Makefile.config and enable CPU mode. Do "make clean" and then make it again.
@eonurk after making caffe mean?
Maybe you can follow this link;
http://caffe.berkeleyvision.org/installation.html#compilation
Hi ! I was also trapped into this problem... Did you guys got this issue solved ? Thanks.
I also had the same problem. FWIW, here are the list of things that I did along with the mistakes I've made to resolve this issue:
Even though I cloned the repository with --recursive
flag, somehow my caffe-fast-rcnn
sub-module was not updated and was not on the faster-rcnn
branch; I don't know why. So, I did the step 2 from their instructions manual
git submodule update --init --recursive
Additionally, you should check whether you're on the correct branch (faster-rcnn
) of the said sub-module.
Add these lines of code at the top of your demo.py
import sys
sys.path.insert(0,"/path/to/caffe/python")
Note: These lines of code should be at the start of your demo.py or it would not work (at least for me, it didn't). Also, make sure that you provide the caffe/python
path correct.
Make sure your PYTHONPATH and CAFFE_ROOT are correct. For example,
$ echo $PYTHONPATH
/home/student/objectDetection/py-faster-rcnn/caffe-fast-rcnn/python
$ echo $CAFFE_ROOT
/home/student/objectDetection/py-faster-rcnn/caffe-fast-rcnn
Note: Notice, the paths are from py-faster-rcnn
repository itself and not some external directory where you might have downloaded/installed the caffe by yourself. This is one of the mistakes that I did and gave the paths of the external directory instead of using their own version of caffe
module.
Recompile and rebuild the Caffe and pycaffe modules. Your code might work even without rebuilding caffe modules but I would strongly suggest you repeat steps 3 and 4 from the instructions manual after you've completed step 1.
Hope this helps someone and save their time. Since it definitely has cost me a significant amount of time and stress to find out the naive mistakes that I did. Cheers!!
P.S. This is my interpretation of the mistakes that I made while running the demo. I may be wrong in some of the explanations given above, I apologize if that is the case. However, these are the steps that I did and it has worked for me.
I did all these with no error but I still get the error:
1205 cd caffe/
1206 make clean
1207 sudo make clean
1208 mkdir build
1209 cd build/
1210 cmake -DBLAS=open ..
1211 make -j8
1212 make pycaffe
1213 echo $PYTHONPATH
1214 echo $CAFFE_ROOT
1215 make install
[jalal@goku build]$ python
Python 3.5.4 |Anaconda custom (64-bit)| (default, Nov 9 2017, 00:39:12)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import caffe
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/scratch/caffe/python/caffe/__init__.py", line 1, in <module>
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File "/scratch/caffe/python/caffe/pycaffe.py", line 13, in <module>
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
ImportError: dynamic module does not define module export function (PyInit__caffe)
@monajalal Hi Mona, Have you solved the issue?
@monajalal Hi Mona, I also have the same error. Have you solved the error?
I think problem comes when you install Caffe on your own in another folder. While cloning the faster-rcnn project, you get Caffe once again in caffe-fast-rcnn. The repository code is set in order to look for Caffe by default in that folder. So you need to remove (or rename) caffe-fast-rcnn folder and add in the env variables your caffe path (as explained by @yanxp )
You should make pycaffe
I make caffe with cmake, should I make pycaffe?
To compile the Python and MATLAB wrappers do make pycaffe
and make matcaffe respectively. Be sure to set your MATLAB and Python paths in Makefile.config first!
$make pycaffe
[ 1%] Built target caffeproto
[ 98%] Built target caffe
[100%] Built target pycaffe
After doing the steps, I tried to run the demo.py I am getting error : ImportError: No module named _caffe But I already have installed caffe. When I try to import caffe from python terminal there's no error.
Where's the Problem?