配置matcaffe



環境

ubuntu 16.04
cuda 8.0
gcc 5.4
matlab 2017
caffe https://gitee.com/etsu/caffe

caffe 編譯:

此處略過(可查看之前的文章)

make matcaffe
make mattest一堆庫的問題


Invalid MEX-file '/datadrive/caffe/matlab/+caffe/private/caffe_.mexa64':

Missing symbol '_ZN6google

這種解決方法:網上可以搜到很多,

最終一種可以用https://github.com/BVLC/caffe/issues/5447 的方法解決。

export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libprotobuf.so.9

其他讓更換matlab下的庫文件鏈接之類的沒敢試,後患無窮。

附帶一份編譯caffe 用的 .profile文件

此文件深藏功與名

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64
#anaoconda2
PATH=$HOME/src/anaconda2/bin:$PATH
#MATLAB
PATH=/usr/local/MATLAB/R2017a/bin:$PATH
#export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4:/usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4:/usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libfreetype.so.6:/usr/lib/x86_64-linux-gnu/libtiff.so.5
export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libprotobuf.so.9
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH


#before compile caffe not include python lib
#export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/src/cuda6-8/lib64"

#after  compile caffe include python lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/src/anaconda2/lib:$HOME/src/cuda6-8/lib64

export LD_INCLUDE_PATH="$HOME/src/cuda6-8/include:$LD_INCLUDE_PATH"
#export PYTHONPATH="$HOME/src/caffe-master-debug/python:$HOME/src/anaconda2/lib/python2.7/site-packages/graphviz:$PYTHONPATH"






發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章