What is Caffe? A deep learning open source library implemented in C ++. Developed mainly by BVLC, a research center at the University of California, Berkeley, and available in C ++, Python, and MATLAB.
Other libraries include:
Library | Contents |
---|---|
Torch7 | New York University |
Cuda-convert | Toronto University |
Chainer | Preferred Networks |
TensorFlow |
For the time being, set aside the others and install what you need for caffe
brew install --fresh -vd snappy leveldb gflags glog szip lmdb
brew install hdf5 opencv
brew install --build-from-source --with-python --fresh -vd protobuf
brew install --build-from-source --fresh -vd boost boost-python
brew install openblas
#You may have to do the following as needed
sudo xcodebuild -license
brew tap homebrew/science
Library | Contents |
---|---|
lmdb | key-value type data store |
hdf5 | file format |
opencv | Image processing library |
protobuf | A library for defining structures in the interface definition language |
boost-python | C++A library to easily write Python modules that wrap classes and functions in |
openblas | Fast BLAS |
Download Caffe
git clone https://github.com/BVLC/caffe.git
cd caffe
cp Makefile.config.example Makefile.config
vim Makefile.config
Modify config file
BLAS: = atlas
to BLAS: = open
Makefile.config
`# CPU_ONLY := 1`
`# BLAS_INCLUDE := $(shell brew --prefix openblas)/include`
`# BLAS_LIB := $(shell brew --prefix openblas)/lib`
When you download it, a caffe folder is created, so go there and go
make clean
make all -j4
make test -j4
make runtest
cd python/
for li in $(cat requirements.txt); do sudo pip install $li; done
cd ../
make pycaffe
It doesn't work ...
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp python/caffe/_caffe.cpp:10:10: fatal error: 'numpy/arrayobject.h' file not found #include <numpy/arrayobject.h> ^ 1 error generated. make: *** [python/caffe/_caffe.so] Error 1
I'm not sure, so switch to TensorFlow! Continued below
Try deep learning with TensorFlow http://qiita.com/northriver/items/17e936343110d392cce8
Recommended Posts