** (People with Docker knowledge are overwhelmingly easier to import and use Docker Image! (Here mac_OS_X% E3% 81% AB% E3% 80% 81caffe% 2Bjupyter_notebook% E7% 92% B0% E5% A2% 83% E6% A7% 8B% E7% AF% 89% E3% 83% A1% E3% 83% A2))) **
Machine, OS: MacBookPro 10.11.4 CPU : 2.2 GHz Intel Core i7 Memory: 16 GB
** 1. Install dependent packages with homebrew **
brew install -vd snappy leveldb gflags glog szip lmdb
brew tap homebrew/science
brew install hdf5 opencv
brew install --build-from-source --with-python -vd protobuf
brew install --build-from-source -vd boost boost-python
The bottom two (protobuf and boost) take quite some time.
** 2. Download Caffe **
It seems that cloning from Github is a good way.
git clone https://github.com/BVLC/caffe.git
** 3. Rewrite Makefile.config **
-First, do the following (make a copy)
cp Makefile.config.example Makefile.config
-Rewrite the following in Makefile.config.
Makefile.config
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1 #Uncomment.
...
# Homebrew puts openblas in a directory that is not on the standard search path
#Enter the path where you installed openblas.
BLAS_INCLUDE := /usr/local/cellar/openblas/0.2.18_2/include
BLAS_LIB := /usr/local/cellar/openblas/0.2.18_2/lib
...
#It seems better to add it.
LIBRARIES += cblas
LDFLAGS += -framework Accelerate
** 4. Compile ** Use : star: CMake (Linker Error will occur with normal Make) Go to caffe / and do the following:
mkdir build
cd build
cmake ..
make all
make install
make runtest
You can probably build it now. Check by running the sample program to see if it can be used. (For Mnist, it is described in detail in this article.) It is already available in C ++. (Basically, run ./build/tools/caffe train --solver = **. Prototxt. Please see the official page for details)
** 5. Build for Python ** Just go to caffe / build and do the following:
make Pycaffe
Don't forget to add Path. (I am .zshrc)
export PYTHONPATH=(path to caffe)/caffe/python:$PYTHONPATH
Now you can use ʻimport caffe`.
・ Official page of Caffe -I installed Caffe so that I can do deep learning on MAC OS X El Capitan -Until running the sample of Deep Learning framework Caffe on Mac OSX 10.11
Recommended Posts