深度学习框架caffe在macOS Heigh Sierra上安装过程实录
2017-10-07 21:12
465 查看
第一步、安装依赖库
brew install -vd snappy leveldb gflags glog szip lmdb brew tap homebrew/science brew install hdf5 opencv brew install protobuf boost
第二步、编译caffe
git clone https://github.com/BVLC/caffe.git cd caffe make all && make test && make runtest
问题一:
in file included from src/caffe/common.cpp:7: In file included from ./include/caffe/common.hpp:19: ./include/caffe/util/device_alternate.hpp:34:10: fatal error: 'cublas_v2.h' file not found #include <cublas_v2.h> ^~~~~~~~~~~~~ 1 error generated.
解决方案:
设置Makefile.config中取消注释CPU_ONLY := 1前面的注释
问题二:
./include/caffe/util/mkl_alternate.hpp:14:10: fatal error: 'cblas.h' file not found #include <cblas.h>
解决方案:
第1步:brew install homebrew/science/openblas
第2步:
修改Makefile.config文件中BLAS:= atlas为BLAS := OpenBlas
修改Makefile.config文件中BLAS的库或头文件:
BLAS_INCLUDE := /usr/local/opt/openblas/include
BLAS_LIB := /usr/local/opt/openblas/lib
问题三:
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'. /bin/sh: line 0: [: -gt: unary operator expected /bin/sh: line 0: [: -gt: unary operator expected LD -o .build_release/lib/libcaffe.so.1.0.0 clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument] ld: framework not found vecLib clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
解决方案:
在命令行中输入:xcode-select --install
第三步、编译pycaffe
make pycaffe
问题一:
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
解决方案:
第1步:brew install numpy
第2步:
修改Makefile.config
去掉注释
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include # PYTHON_LIB += $(shell brew --prefix numpy)/lib
变为
PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include PYTHON_LIB += $(shell brew --prefix numpy)/lib
问题二:
ld: library not found for -lboost_python clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [python/caffe/_caffe.so] Error 1
解决方案:
brew install boost-python
安装caffe的python依赖:
cd python
for req in $(cat requirements.txt); do pip install --user $req; done
相关文章推荐
- 深度学习框架caffe及py-faster-rcnn详细配置安装过程
- 深度学习框架caffe及py-faster-rcnn详细配置安装过程
- ubuntu下深度学习框架caffe的安装(cpu模式下)
- Caffe深度学习框架安装(Ubuntu14.04+cuda8.0)
- 【深度学习框架Caffe学习与应用】第一课 Opencv安装
- 零错误安装基于ubuntu14.04LTS的CUP版本深度学习框架Caffe
- 深度学习 deep learning 深度学习框架 caffe 深入学习过程(开篇)
- 安装 Caffe , Berkely的深度学习框架
- 深度学习框架caffe的安装无GPU版
- 深度学习框架Caffe教程和安装指南 Caffe Tutorial
- linux(ubuntu)下安装深度学习框架caffe
- linux(ubuntu)下安装深度学习框架caffe
- linux(ubuntu)下安装深度学习框架caffe
- Ubuntu16.04安装深度学习框架caffe详细步骤讲解
- 深度学习框架caffe训练过程
- 深度学习框架-caffe安装-环境[Mac OSX 10.12]
- 深度学习框架Caffe在Mac上的安装和测试
- 深度学习框架-caffe安装-Mac OSX 10.12
- 安装 Caffe , Berkely的深度学习框架
- Mac下安装caffe深度学习框架