Installing Caffe and PyCaffe on Ubuntu 14.04

1. Install OpenCV 2.4.11

2. Install general dependencies

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

CUDA: Install via the NVIDIA package instead of apt-get to be certain of the library and driver versions. Install the library and latest driver separately; the driver bundled with the library is usually out-of-date. This can be skipped for CPU-only installation.

BLAS: install ATLAS by sudo apt-get install libatlas-base-dev or install OpenBLAS or MKL for better CPU performance.

Python (optional): if you use the default Python you will need to sudo apt-get install the python-dev package to have the Python headers for building the pycaffe interface.

3. remaining dependencies for 14.04

sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

3. clone and install Caffe
git clone
cd /path/to/caffe/folder

mkdir build 
cd build 
cmake .. 
make all 
make install 
make runtest

4. Pycaffe installation

sudo apt-get install cython

sudo apt-get install python-skimage
sudo apt-get install python-pip
sudo pip install protobuf

make pycaffe

To import the caffe Python module after completing the installation, add the module directory to your $PYTHONPATH by export PYTHONPATH=/path/to/caffe/python:$PYTHONPATH

5. run python terminal and check by typing:
import caffe