Installing Caffe on OS X El Capitan

(Won’t be much content to this post – this is mostly for future reference.)

Step 0: Install brew and CUDA

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew update

Download and install CUDA

echo "export PATH=/usr/local/cuda/bin:$PATH" >> ~/.profile
echo "export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH" >> ~/.profile

Step 1: Caffe dependencies

brew install python
brew install wget
brew install protobuf
brew install boost-python
brew install lmdb
brew install leveldb
brew install snappy
brew install gflags
brew install glog
brew tap homebrew/science
brew install opencv
brew install hdf5

Step 2: Caffe Python dependencies

pip install numpy
pip install scipy
pip install Cython
pip install scikit-image
pip install protobuf
pip install lmdb
pip install leveldb
pip install python-gflags
pip install h5py

Step 3: Build Caffe from source

git clone https://github.com/fzliu/caffe.git
cd caffe && wget https://gist.githubusercontent.com/fzliu/bef9b8e8ea4f3c082101/raw/8697dff9233f42ffca50595e0fb6915b67a4566e/Makefile.config
make -j8 && make pycaffe