ubuntu 64位系统编译caffe,你所不知的那些坑!

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

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值