3

System information:

Ubuntu 16.04, Anaconda 1.6.9, Python 3.6.4, libopencv 3.4.1, opencv 3.4.1, py-opencv 3.4.1.

Problem definition: I just upgraded my opencv to 3.4 through anaconda and found could not import.

The import error is:

ImportError: anaconda3/lib/python3.6/site-packages/../../libopencv_dnn.so.3.4: undefined symbol: _ZNK6google8protobuf7Message25InitializationErrorStringB5cxx11Ev

Ishara Madhawa
  • 3,549
  • 5
  • 24
  • 42
Tengerye
  • 1,796
  • 1
  • 23
  • 46

2 Answers2

4

The following solution works for me, although not sure why and how.

  1. conda install -c defaults libprotobuf protobuf
  2. conda install -c menpo opencv3
Tengerye
  • 1,796
  • 1
  • 23
  • 46
0

Have you tried this answer from GitHub:

  1. Configure /usr/local/cuda/include/host_config.h as suggested. (remove the gcc 5 error from the CUDA header host_config.h)
  2. sudo apt-get autoremove libprotobuf-dev protobuf-compiler
  3. then compile the protobuf-2.5.0 from src and install Please config the gcc when you compile protobuf ./configure --prefix=/usr/local/ CC=/usr/bin/gcc

Also (GitHub user groakat mentions):

for me this problem was caused because I had protobuf installed in anaconda. If you have protobuf installed in your anaconda environment, you have to remove all files by hand, as conda uninstall protobuf does not remove all the library files.

Alex W
  • 37,233
  • 13
  • 109
  • 109
  • Thank you for your kind reply. But it seems I don't have the path `/usr/local/cuda/include/host_config.h`, but I have `cudatoolkit` installed on my Anaconda, that's strange. – Tengerye Jun 14 '18 at 01:35
  • I also don't understand why does the error involve caffe? – Tengerye Jun 14 '18 at 01:42