Ubuntu 14 Caffe安装(无GPU)

2016-12-03  本文已影响0人  嗯我是一个胖子

前提

已经安装好Anaconda、opencv2.4.8以及dlib

正文

$ sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
$ sudo apt-get install --no-install-recommends libboost-all-dev
$ sudo apt-get install libatlas-base-dev

可以安装OpenBLAS 或 MKL,以提升CPU性能,但是要修改caffe中Makefile文件…

$ sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
$ cd ~
$ git clone git://github.com/BVLC/caffe.git
$ cd ~/caffe
$ cp Makefile.config.example Makefile.config
$ make all
$ make test
$ make runtest

存在问题解决

安装glog/gflags/lmdb

wget https://google-glog.googlecode.com/files/glog-0.3.3.tar.gz
tar zxvf glog-0.3.3.tar.gz
cd glog-0.3.3
./configure
make
sudo make install
wget https://github.com/schuhschuh/gflags/archive/master.zip
unzip master.zip
cd gflags-master
mkdir build && cd build
export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
make
sudo make install
git clone https://github.com/LMDB/lmdb
cd lmdb/libraries/liblmdb
make
sudo make install
make  sudo make install

配置pycaffe

$ sudo apt-get install python-numpy python-scipy python-matplotlib python-sklearn python-skimage python-h5py python-protobuf python-leveldb python-networkx python-nose python-pandas python-gflags Cython ipython
$ sudo apt-get install protobuf-c-compiler protobuf-compiler
$ cd ~/caffe
$ make pycaffe
$ sudo gedit /etc/profile
export PYTHONPATH=/实际path/caffe/python:$PYTHONPATH
$ source /etc/profile
$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import caffe
上一篇 下一篇

猜你喜欢

热点阅读