2021-05-12 14:32:11
Ubuntu 16.04下matcaffe的呼叫問題
2020-06-16 17:23:45
在Ubuntu 16.04下編譯matlab caffe完成之後:
make mattest
的時候出錯:
錯誤提示: _ZN2cv8imencodeERKNSt7_cxx1112basic_string
其中imencode是opencv_highgui裡的函數
這個錯誤也就是說matlab自帶的opencv庫和caffe依賴的opencv不一致.
解決方法如下:
寫一個matlibs.sh的指令碼:
rm -rf /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6 ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 /usr/local/MATLAB/R2016a/sys/os/glnxa64/libstdc++.so.6 rm -rf /usr/local/MATLAB/R2016a/bin/glnxa64/libopencv_core.so.2.4 ln -s /usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4.9 /usr/local/MATLAB/R2016a/bin/glnxa64/libopencv_core.so.2.4 rm -rf /usr/local/MATLAB/R2016a/bin/glnxa64/libopencv_imgproc.so.2.4 ln -s /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4.9 /usr/local/MATLAB/R2016a/bin/glnxa64/libopencv_imgproc.so.2.4 rm -rf /usr/local/MATLAB/R2016a/bin/glnxa64/libopencv_highgui.so.2.4 ln -s /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9 /usr/local/MATLAB/R2016a/bin/glnxa64/libopencv_highgui.so.2.4
然後在控制台中執行該指令碼,同時還要注意路徑.
sudo sh ./matlibs.sh
相關文章