Ubuntu16.04安裝caffe中遇到的問題總結
解決辦法是依據出現錯誤的順序而給出的,為了方便,可以直接先執行所有解決辦法後再安裝caffe。
1. ./include/caffe/common.hpp:5:27: fatal error: gflags/gflags.h: No such file or directory
解決辦法:sudo apt-get install libgflags-dev
2. ./include/caffe/util/mkl_alternate.hpp:14:19: fatal error: cblas.h: No such file or directory
解決辦法:sudo apt-get install libblas-dev
3. ./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory
解決辦法:在Makefile.config找到以下行並新增藍色部分
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
/usr/lib/x86_64-linux-gnu/hdf5/serial
4. ./include/caffe/util/db_lmdb.hpp:8:18: fatal error: lmdb.h: No such file or directory
解決辦法:sudo apt install liblmdb-dev
5. /usr/bin/ld: cannot find -lcblas
/usr/bin/ld: cannot find -latlas
解決辦法:sudo apt install libatlas-base-dev