Caffe install on ubuntu for anaconda with python 2.7 fails with libpng16.so.16 not found

后端 未结 3 1889
失恋的感觉
失恋的感觉 2021-01-20 20:33

So I have installed anaconda with python 2.7 and installed all of the requirements for Caffe library. I ensured that opencv is installed by

import cv2


        
相关标签:
3条回答
  • 2021-01-20 20:36

    I ran into the same problem and I fixed it by adding an -rpath in my Makefile.config :

    LINKFLAGS := -Wl,-rpath,$(HOME)/anaconda/lib

    I think this is the correct fix because it (-rpath) tells GCC where it can find libraries (libjpeg, libpng) that other libraries (in this case opencv) depend on.

    0 讨论(0)
  • 2021-01-20 20:50

    Per @cel suggestion -

    ldd libopencv_highgui.so 
    

    shows the files on which this lib depends. Couple of them (not the libpng!) were located in folder which I haven't included into the makefile.config. After including their folder into MakeFile build succeeded. Notice: after building the caffe you may won't to go in Spyder into the PythonPath manager and add the caffe's folder into it (or just include it into pythonpath if you are not using anaconda\spyder).

    0 讨论(0)
  • 2021-01-20 20:53

    Adding

    LINKFLAGS := -Wl,-rpath,$(HOME)/anaconda/lib
    

    in to Makefile.config worked.

    0 讨论(0)
提交回复
热议问题