codeblocks配置caffe环境,调用caffe模型

来源:互联网 发布:php redis auth 编辑:程序博客网 时间:2024/06/05 19:31

1.首先需要搭配好caffe的运行环境,可参考我另一篇博客:http://blog.csdn.net/llwjason5555/article/details/62424085

2.打开codeblocks,建立工程,右击工程,选择Build options,Linker setting左边添加opencv动态库和/caffe/build/lib/libcaffe.so,右边添加

-pthread-lcaffe -lglog -lgflags -lprotobuf -lboost_system -lboost_filesystem-lm  -lleveldb -lsnappy -llmdb -lboost_thread-lstdc++ -lcblas -latlas

3.Search directories->Compiler: opencv中include路径和/caffe/include, /caffe/build/src

4.Search directories->Linker: opencv中lib库路径和/caffe/build/lib

5.Compiler setting->#define,添加

CPU_ONLYUSE_OPENCVUSE_LEVELDBUSE_LMDB

5.编写调用caffe模型的程序即可运行

备注:我搭建的是CPU环境下的caffe