Install brew and pip
(sudo easy_install pip
)
brew update
brew install homebrew/science/openblas
brew install boost
# caffe doesn't work with 1.58.0
brew switch boost 1.56.0
brew install opencv
brew install --build-from-source --with-python --fresh -vd protobuf
brew install glog
brew install gflags
brew install hdf5
brew install leveldb
brew install lmdb
brew install --build-from-source --fresh -vd boost-python
sudo pip install pillow
sudo pip install ipython
sudo pip install scikit-image
git clone https://github.com/BVLC/caffe.git
cd caffe
cp Makefile.config.example Makefile.config
BLAS := open
BLAS_INCLUDE := /usr/local/opt/openblas/include
BLAS_LIB = /usr/local/opt/openblas/lib
- Add
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
toPYTHON_INCLUDE
- Add
/usr/local/opt/opencv
toINCLUDE_DIRS
- Uncomment the
PYTHON_INCLUDE
andPYTHON_LIB
- Uncomment
USE_PKFG_CONFIG
line # could not find this line
- Run
make pycaffe -j8
(adjust for # of cores on your system) cd python
- Run
DYLD_FALLBACK_LIBRARY_PATH=/usr/local/cuda/lib python -c "import caffe"
to verify things worked (will take a few minutes to complete the first time or so)
- Download http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel to
models/bvlc_googlenet/
I don't know how to merge your changes into my copy of the gist, but I manually added it in. I fat-fingered
USE_PKFG_CONFIG
, it should just beUSE_PKG_CONFIG
. Thanks!