Caffe import error in python

1,578 views
Skip to first unread message

Ali Kohan

unread,
Jun 14, 2016, 3:53:31 PM6/14/16
to Caffe Users
Hello,

I have successfully passed installation of caffe in Ubuntu 16.04 with python interface. But when I want to Import Caffe in python, I get this error from libcaffe.so.1.0.0-rc3:

ImportError: /home/ali/caffe/python/caffe/../../build/lib/libcaffe.so.1.0.0-rc3: undefined symbol: _ZN2cv8imencodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11_InputArrayERSt6vectorIhSaIhEERKSB_IiSaIiEE

After a destructive time of looking around in seek of a solution, I am still left clueless about what the problem is ! Does anyone know what does this mean ? and perhaps the solution to it?  I will be so grateful.

Thanks,
Ali

Joshua Slocum

unread,
Jun 14, 2016, 4:28:16 PM6/14/16
to Ali Kohan, Caffe Users
What version of OpenCV did you build Caffe with? Is it in your load library path? 

--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/7394ce51-ed29-457c-8e83-da5982580626%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ali Kohan

unread,
Jun 15, 2016, 5:51:43 AM6/15/16
to Caffe Users
My OpenCV version is 2.4.10.

How can I make sure if it is in my load library path ?  Thanks .

Sharon Ong

unread,
Jun 15, 2016, 11:59:08 PM6/15/16
to Caffe Users
I'm getting the same error message as well, but it's for the MATLAB interface.

Abhishek Ramesh

unread,
Jun 16, 2016, 6:11:39 AM6/16/16
to Caffe Users
I have no clue about the error message, but I just wanted to share with you this blog: http://hanzratech.in/2015/07/27/installing-caffe-on-ubuntu.html
I found this to be the best guide for installation of caffe on ubuntu, just check the steps and run "make all" "make test" "make runtest" and "make pycaffe" on ubuntu terminal. Check if all of them work successfully. It should take about 10 mins to test them all.

Haofu Liao

unread,
Jun 27, 2016, 11:24:54 PM6/27/16
to Caffe Users
In my case, this is because I installed opencv through conda and removing opencv from conda solves this problem. I think it is probably because conda's opencv somehow
overwrites ubuntu's default opencv. 

f201...@goa.bits-pilani.ac.in

unread,
Jul 4, 2016, 12:49:08 AM7/4/16
to Caffe Users
Did you try the following?

To your PYTHONPATH, add path to python folder in caffe. This had worked for me.


On Wednesday, June 15, 2016 at 3:53:31 AM UTC+8, Ali Kohan wrote:

Sumeet Saurav

unread,
Jul 9, 2016, 2:36:37 PM7/9/16
to Caffe Users
Hello Ali Kohan,

I am also facing the same problem with the installation. If you solved the problem, could you please guide me.

Thank you

ukonl...@gmail.com

unread,
Oct 27, 2016, 10:37:07 AM10/27/16
to Caffe Users
I had the same problem. In my case, just running

conda uninstall opencv

in terminal solves the problem.
Hope this helps.

Dick Sven

unread,
Sep 17, 2017, 4:04:00 AM9/17/17
to Caffe Users
conda uninstall opencv

solved my problem.


在 2016年10月27日星期四 UTC+8下午10:37:07,ukonl...@gmail.com写道:
Reply all
Reply to author
Forward
0 new messages