1、错误一: “fatal error: hdf5.h: 没有那个文件或目录”
解决方法: sudo apt-get libhdf5-serial-dev
修改路径参考:https://blog.csdn.net/wshdkf/article/details/79470372
2、错误二 :prompt-toolkit 1.0.15 has requirement six>=1.9.0, but you’ll have six 1.4.1 which is incompatible.
解决方法:
pip install six --user -U
pip install ipython --user -U
3、错误三:编译 pycaffe时报错:fatal error: numpy/arrayobject.h没有那个文件或目录
解决方法:
sudo apt-get install python-numpy
然后编译pycaffe接口
sudo make pycaffe
如果还是不行,
终端输入
python
import numpy as np
np.get_include()
执行结果如下:
对比caffe目录下的Makefile.config中的PYTHON_INCLUDE,发现与之前查询得到numpy路径有点不同:
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/lib/python2.7/dist-packages/numpy/core/include
要加一个local,变成:
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/local/lib/python2.7/dist-packages/numpy/core/include
最后执行:
sudo make pycaffe
随后,输入ubuntu系统登录密码,即可编译成功,结果如下:
4、错误四:“/usr/include/c++/5/bits/c++0x_warning.h:32:2:error: #error This file requires compiler and library supportfor the ISO C++ 2011 standard. Thissupportmust be enabled with the -std=c++11 or -std=gnu++11compileroptions.”
原因是在配置cuda的时候报错,编译器没有指定。
解决方法:
在Makefile里面找到如下的内容,并添加上-std=c++11
CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -std=c++11
NVCCFLAGS += -D_FORCE_INLINES -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS) -std=c++11
LINKFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -std=c++11