caffe icon indicating copy to clipboard operation
caffe copied to clipboard

"import caffe FAILED" after $conda install opencv

Open duchengyao opened this issue 10 years ago • 5 comments

I found caffe not work , after install opencv from conda.

>>> import caffe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/duchengyao/project/caffe/python/caffe/__init__.py", line 1, in <module>
    from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver
  File "/home/duchengyao/project/caffe/python/caffe/pycaffe.py", line 13, in <module>
    from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
ImportError: /home/duchengyao/project/caffe/python/caffe/../../build/lib/libcaffe.so.1.0.0-rc3: undefined symbol: _ZN2cv8imencodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11_InputArrayERSt6vectorIhSaIhEERKSB_IiSaIiEE

The version from conda is 2.4.10, but pkg-config is version 2.4.9.1

pkg-config --modversion opencv
2.4.9.1

Simply conda uninstall opencv , caffe works well.

Ubuntu 16 , pyenv+ anaconda2 , Cuda 8 .

Thanks ^_^

duchengyao avatar Aug 26 '16 12:08 duchengyao

It seems it's you're giving it the wrong path. Have you tried looking at Makefile.config? A good way to search for archives is "sudo find / | grep 'your.archive'"

coelho-oliva avatar Aug 26 '16 17:08 coelho-oliva

@Caduunb, thanks , Which path do you mean? OpenCV or anaconda?

Regards,

duchengyao avatar Aug 27 '16 10:08 duchengyao

I mean Anaconda's path. Try checking it out and then do all the make's again. If the same problem continues, try with OpenCV. If another problem appears, come here :) P.S.: If it works, please, come here to close the topic and tell how you solved it.

coelho-oliva avatar Aug 27 '16 14:08 coelho-oliva

I have the same issue.

lesterlitch avatar Aug 30 '16 01:08 lesterlitch

Please ask installation questions on the mailing list. If you're having trouble, you might want to try the Caffe Dockerfile to take care of installation for you.

From https://github.com/BVLC/caffe/blob/master/CONTRIBUTING.md:

Please do not post usage, installation, or modeling questions, or other requests for help to Issues. Use the caffe-users list instead. This helps developers maintain a clear, uncluttered, and efficient view of the state of Caffe.

shelhamer avatar Sep 10 '16 05:09 shelhamer