0. 環境
ubuntu 18.4 #其實此版本已經可以安裝pre-compiled caffe:
sudo apt install caffe-cpu
但是由於這樣沒有pycaffe??
1. caffe github源碼get
https://github.com/BVLC/caffe/
2. 編譯
1. cd $CAFFEROOT
2. cp Makefile.config.example Makefile.config
3. #修改caffe設置 例如cpu-only=1等
修改makefile.config設置中的 CPU_ONLY := 1;
PYTHON_INCLUDE := /usr/include/python3.6 \
4. make all
#4. make all -jN 可以使得make更快
報錯1:
./include/caffe/util/io.hpp:8:18: fatal error: hdf5.h: no such file or directory
解決辦法:
報錯2:
/usr/bin/x86_64-linux-gnu-ld: cannot find -lcblas