'undefined symbol: _ZNK7leveldb6Status8ToStringB5cxx11Ev' while importing caffe

1,089 views
Skip to first unread message

srinathb...@gmail.com

unread,
Mar 6, 2017, 12:46:39 PM3/6/17
to Caffe Users

I installed caffe in ubuntu 16.04 with python layer support. Everything gone well from make all command to make distribute command. Once i import caffe in python, the above problem shoots up. Need your help.
System: ubuntu 16.04
Python version: 2.7.1

some suggested me to rebuild leveldb from source with gcc-5. I even tried it but the problem remains same.

Cat

unread,
Mar 6, 2017, 3:52:13 PM3/6/17
to Caffe Users
I don't know if this is related, but I had a look at my paths and thought this might help. My PYTHONPATH is set to /home/user/Downloads/caffe-master/python/caffe, so give this a go maybe?

Srinath Balakrishnan

unread,
Mar 6, 2017, 11:33:14 PM3/6/17
to Cat, Caffe Users
doesn't help. Since i am importing caffe, path has to be '/home/user/Downloads/caffe-master/python' 

Best regards,
Srinath Balakrishnan

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/tPX5xKB8xWM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@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/7f9c10f3-b2ce-448d-b680-515a036e2787%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Balamurugan V R

unread,
Mar 10, 2017, 1:38:49 PM3/10/17
to Caffe Users
Hi Srinath,

How did you install leveldb in the system? Looks like this is problem due to using different compilers for compiling leveldb and caffe (typically happens when you do package install of leveldb).

Just 0.02$.

Cheers,
Bala

Srinath Balakrishnan

unread,
Mar 13, 2017, 1:52:45 AM3/13/17
to Balamurugan V R, Caffe Users
yeah you are right. i compiled caffe with gcc-4.9 and leveldb from source with gcc-5. Compiling leveldb from source was suggested in some forum for 'undefined symbol: ...' but it was present still. 
For caffe, it is suggested in  https://github.com/intel/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide to compile with gcc-4.9. This one is to avoid issues with Cuda 7.5. I compiled caffe in CPU ONLY mode so the step is unwarranted here. 

I removed leveldb and installed it again, and compiled caffe with gcc-5. I worked without any issue. No import error.

Earlier i had similar issue with my lab desktop, it was throwing 'undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev caffe import error' while importing caffe in python environment. I solved the issue by compiling google's protobuf from source with gcc-5.

Best regards,
Srinath Balakrishnan

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/tPX5xKB8xWM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users+unsubscribe@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.

Balamurugan V R

unread,
Mar 13, 2017, 2:22:54 AM3/13/17
to Caffe Users, vrbala...@gmail.com
Yes, I was bit by gcc version > 4.9 recently in my install. Also, as you noted with leveldb, sometimes "make install" doesn't do the job and I always had to remove the libraries by hand and re-install fresh.

Glad that the issue is resolved. 


On Monday, 13 March 2017 11:22:45 UTC+5:30, Srinath Balakrishnan wrote:
yeah you are right. i compiled caffe with gcc-4.9 and leveldb from source with gcc-5. Compiling leveldb from source was suggested in some forum for 'undefined symbol: ...' but it was present still. 
For caffe, it is suggested in  https://github.com/intel/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide to compile with gcc-4.9. This one is to avoid issues with Cuda 7.5. I compiled caffe in CPU ONLY mode so the step is unwarranted here. 

I removed leveldb and installed it again, and compiled caffe with gcc-5. I worked without any issue. No import error.

Earlier i had similar issue with my lab desktop, it was throwing 'undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev caffe import error' while importing caffe in python environment. I solved the issue by compiling google's protobuf from source with gcc-5.

Best regards,
Srinath Balakrishnan

On Sat, Mar 11, 2017 at 12:08 AM, Balamurugan V R <vrbala...@gmail.com> wrote:
Hi Srinath,

How did you install leveldb in the system? Looks like this is problem due to using different compilers for compiling leveldb and caffe (typically happens when you do package install of leveldb).

Just 0.02$.

Cheers,
Bala

On Monday, 6 March 2017 23:16:39 UTC+5:30, srinathb...@gmail.com wrote:

I installed caffe in ubuntu 16.04 with python layer support. Everything gone well from make all command to make distribute command. Once i import caffe in python, the above problem shoots up. Need your help.
System: ubuntu 16.04
Python version: 2.7.1

some suggested me to rebuild leveldb from source with gcc-5. I even tried it but the problem remains same.

--
You received this message because you are subscribed to a topic in the Google Groups "Caffe Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/caffe-users/tPX5xKB8xWM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to caffe-users...@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages