编译caffe和matlab接口问题
来源:互联网 发布:飞秋for mac 编辑:程序博客网 时间:2024/05/19 17:02
原来已经在自己的电脑上安装过一次caffe,但这次在服务器上安装又出现了许多问题。
在
make
的时候报错,如下。AR -o .build_release/lib/libcaffe.aLD -o .build_release/lib/libcaffe.so.1.0.0/bin/ld: cannot find -lboost_system/bin/ld: cannot find -lboost_filesystem/bin/ld: cannot find -lboost_threadcollect2: error: ld returned 1 exit statusmake: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
明显原因没有找到包,于是在终端下输入
locate libboost_system
返回
[ymd@tjdp-4 caffe]$ locate libboost_thread/home/wzk/Downloads/Xilinx_Vivado_SDK_2015.4_1118_2/lib/lnx64.o/libboost_thread.so/home/wzk/Downloads/Xilinx_Vivado_SDK_2015.4_1118_2/lib/win64.o/libboost_thread.dll/home/ymd/matlab/bin/glnxa64/libboost_thread.so.1.49.0/opt/boost-1.59/lib/libboost_thread.a/opt/boost-1.59/lib/libboost_thread.so/opt/boost-1.59/lib/libboost_thread.so.1.59.0/usr/lib64/libboost_thread-mt.so.1.53.0......
在caffe的Makefile.config中找到
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/includeLIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
加上路径/opt/boost-1.59/lib/
剩下的包同理,没有找到的话参考其他教程。
再次make all
,(之前最好make clean
),就没问题了。
2.在配置matlab的caffe接口时,主要步骤参考caffe+MATLAB配置,但遇到一长串错误。
[ymd@tjdp-4 caffe]$ make matcaffeMEX matlab/+caffe/private/caffe_.cppBuilding with 'g++'.Warning: You are using gcc version '4.8.5-4)'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.Warning: You are using gcc version '4.8.5'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release./home/ymd/caffe/matlab/+caffe/private/caffe_.cpp: In function \u2018void delete_solver(int, mxArray**, int, const mxArray**)\u2019:/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:208:3: warning: lambda expressions only available with -std=c++11 or -std=gnu++11 [enabled by default] }), solvers_.end()); ^/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:208:4: error: no matching function for call to \u2018remove_if(std::vector<boost::shared_ptr<caffe::Solver<float> > >::iterator, std::vector<boost::shared_ptr<caffe::Solver<float> > >::iterator, delete_solver(int, mxArray**, int, const mxArray**)::__lambda0)\u2019 }), solvers_.end()); ^/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:208:4: note: candidate is:In file included from /usr/include/c++/4.8.2/algorithm:62:0, from ./include/caffe/blob.hpp:4, from ./include/caffe/caffe.hpp:7, from /home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:18:/usr/include/c++/4.8.2/bits/stl_algo.h:1134:5: note: template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate) remove_if(_ForwardIterator __first, _ForwardIterator __last, ^/usr/include/c++/4.8.2/bits/stl_algo.h:1134:5: note: template argument deduction/substitution failed:/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp: In substitution of \u2018template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate) [with _FIter = __gnu_cxx::__normal_iterator<boost::shared_ptr<caffe::Solver<float> >*, std::vector<boost::shared_ptr<caffe::Solver<float> > > >; _Predicate = delete_solver(int, mxArray**, int, const mxArray**)::__lambda0]\u2019:/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:208:4: required from here/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:208:4: error: template argument for \u2018template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)\u2019 uses local type \u2018delete_solver(int, mxArray**, int, const mxArray**)::__lambda0\u2019 }), solvers_.end()); ^/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:208:4: error: trying to instantiate \u2018template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)\u2019/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp: In function \u2018void delete_net(int, mxArray**, int, const mxArray**)\u2019:/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:293:3: warning: lambda expressions only available with -std=c++11 or -std=gnu++11 [enabled by default] }), nets_.end()); ^/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:293:4: error: no matching function for call to \u2018remove_if(std::vector<boost::shared_ptr<caffe::Net<float> > >::iterator, std::vector<boost::shared_ptr<caffe::Net<float> > >::iterator, delete_net(int, mxArray**, int, const mxArray**)::__lambda1)\u2019 }), nets_.end()); ^/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:293:4: note: candidate is:In file included from /usr/include/c++/4.8.2/algorithm:62:0, from ./include/caffe/blob.hpp:4, from ./include/caffe/caffe.hpp:7, from /home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:18:/usr/include/c++/4.8.2/bits/stl_algo.h:1134:5: note: template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate) remove_if(_ForwardIterator __first, _ForwardIterator __last, ^/usr/include/c++/4.8.2/bits/stl_algo.h:1134:5: note: template argument deduction/substitution failed:/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp: In substitution of \u2018template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate) [with _FIter = __gnu_cxx::__normal_iterator<boost::shared_ptr<caffe::Net<float> >*, std::vector<boost::shared_ptr<caffe::Net<float> > > >; _Predicate = delete_net(int, mxArray**, int, const mxArray**)::__lambda1]\u2019:/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:293:4: required from here/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:293:4: error: template argument for \u2018template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)\u2019 uses local type \u2018delete_net(int, mxArray**, int, const mxArray**)::__lambda1\u2019 }), nets_.end()); ^/home/ymd/caffe/matlab/+caffe/private/caffe_.cpp:293:4: error: trying to instantiate \u2018template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)\u2019make: *** [matlab/+caffe/private/caffe_.mexa64] Error 255
在http://www.caffecn.cn/?/question/1145的评论一楼给出了解决方法,在Makefile.config添加CXXFLAGS += -std=c++11 再编译下就好了.
[ymd@tjdp-4 caffe]$ make matcaffeMEX matlab/+caffe/private/caffe_.cppBuilding with 'g++'.Warning: You are using gcc version '4.8.5-4)'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.Warning: You are using gcc version '4.8.5'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.MEX completed successfully.
successfully!!!!!!!!!!!
在零零碎碎找了一大堆资料后并且安装成功后,发现了一个安装大礼包:配好caffe后,编译MATLAB接口。
参考
[1]http://blog.csdn.net/zjq2008wd/article/details/17450033
[2]http://www.caffecn.cn/?/question/1145
[3]http://blog.csdn.net/fangbinwei93/article/details/52865461
[4]http://blog.csdn.net/weiqi_fan/article/details/71023222
[5]https://yq.aliyun.com/articles/5748
[6]http://blog.csdn.net/u012746763/article/details/50419153
[7]http://caffe.berkeleyvision.org/tutorial/interfaces.html(官方文档)
[8]http://caffe.berkeleyvision.org/installation.html(官方文档)
- 编译caffe和matlab接口问题
- caffe编译matlab 接口以及出错问题
- caffe 编译 matlab 接口
- 编译Caffe的Matlab接口
- Caffe的MATLAB接口编译
- caffe配置之编译python和MATLAB接口
- windows下编译Caffe的MATLAB接口
- caffe在window编译matlab接口
- 配好caffe后,编译MATLAB接口
- caffe编译matlab接口的问题解决。
- 在ubuntu编译caffe的matlab接口
- 集群管理——开机B7问题(内存条ERROR),caffe编译matlab接口错误解决方法
- windows系统下caffe的安装和编译及配置matlab接口和gpu加速
- caffe-windows cpu下编译python接口/matlab接口
- Windows下编译Caffe并编译Matlab接口
- Windows下编译Caffe并编译Matlab接口
- 如何快糙好猛地在Windows下编译CAFFE并使用其matlab和python接口
- 如何快糙好猛地在Windows下编译CAFFE并使用其matlab和python接口
- 进程间通信方式(三)消息队列
- java.util.concurrent.TimeoutException: android.view.ThreadedRenderer.finalize() timed out after 10 s
- Oc GDataXML(DOM)解析分区表格
- ARM9 S3C2451 UART 理解
- Oc NSXMLParse(SAX)解析表格
- 编译caffe和matlab接口问题
- An_MVP_模式(okhttp)解析RecyclerView/XRecyclerView
- 多数据源配置spting-mybatis
- Oc NSXMLParse(SAX)解析分区表格
- echarts相关设置,看注释
- LeetCode 679: 24 Game 解题与思考
- 5
- Oc Json解析 表格
- 第八周项目二——顺序串算法