首页 > 学院 > 开发设计 > 正文

caffe install in ubuntu 16.04

2019-11-06 07:21:24
字体:
来源:转载
供稿:网友

Forgive me. I have to record the PRocess in this blog in English for I do not install Chinese input method in new Ubuntu system yet.

1 Install opencv

Download opencv 2.49(recommend) from offical website.Install some required library. sudo apt-get install build-essential cmake libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-devcreate folder in source folder of opencv mkdir release, then cd ./releasecmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..make allsudo make allsudo gedit /etc/ld.so.conf.d/opencv.conf and input /usr/local/lib

2 install cuda

I downgrade gcc and g++ to 4.7 for my cuda version is 7.5. Or you cant install cuda with 8.0 version sudo apt-get install gcc-4.7 g++-4.7 cd /usr/bin sudo rm -fr gcc g++ sudo ln -s gcc-4.4 gcc sudo ln -s g++-4.4 g++ gcc -v g++ -vDownload cuda(*.run recomend) from offical websitinstall Add cuda environment variable. sudo gedit /etc/profile PATH=/usr/local/cuda/bin:$PATH export PATH source /etc/profileadd path of lib sudo gedit /etc/ld.so.conf.d/cuda.conf /usr/local/cuda/lib64 sudo ldconfigI upgrade gcc and g++ to its original version

3 Install third party libraries

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libboost-all-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler libatlas-base-dev There are three kinds of clbas libraries but atlas is ease to install.

4 compile caffe

problem like can’t find hdf5.h, add the path hdft_serial to makefile and Makefile.config problem with google protobuf, compile protobuf with source code from github(it need to download gmock over the wall but you can download from github and find it by yourself ). problem with gcc version when nvcc compile caffe cu file, just comment one line in one file, but I forget the exact file . 5 python interface compile use pyenv and anaconda (recommend Install method)

sudo apt-get install pip sudo pip install -r ./python/requirements.txt

protobuf compile with source code download gmock and protobuf, and extract gmock to root directory of protobuf. c++ interface

sudo apt-get install autoconf automake libtool curl./autogen./configuremakemake checksudo make install

python interface

cd pythonpython setup.py buildpython setup.py testpython setup.py install
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表