参考文章:http://www.jianshu.com/p/9a84cc434e05
错误1:regex
编译项目,报与boost相关的regex正则表达式库出现问题,在项目中我们不需要正则表达式,所以将相关语句注释掉即可。进入项目libcaffe中,进入detection_output_layer.cu文件,将所有出现regex和rv的语句注释掉。进入detection_output_layer.cpp文件,将所有出现regex和rv的语句注释掉。进入detection_output_layer.hpp中,将语句#include <boost/regex.hpp>注释掉。错误2.fatal error C1189: #error : ERROR macro is defined.
解决方法1):
在工程加上预编译宏GLOG_NO_ABBREVIATED_SEVERITIES
C/C++ --> 预处理器 --> 预处理器定义 --> 加上GLOG_NO_ABBREVIATED_SEVERITIES宏 保存,编译通过~
解决方法2):试验成功
Solution https://hpc.nih.gov/development/glog.html
file: \include\caffe\util\bbox_util.hpp + \include\caffe\common.hpp
add
#define GLOG_NO_ABBREVIATED_SEVERITIES
before
#include <glog/logging.h>
错误3:expected an identifier in caffe.pb.h
解决:修改bbox_util.cu,注释掉所有带thrust的语句
修改detection_output_layer.cu和detection_output_layer.cpp文件,注释掉所有regex和rv的语句
//boost::regex exp("\"(null|true|false|-?[0-9]+(\\.[0-9]+)?)\"");
//std::string rv = boost::regex_replace(ss.str(), exp, "$1");
//outfile << rv.substr(rv.find("["), rv.rfind("]") - rv.find("["))
// << std::endl << "]" << std::endl;
修改detection_output_layer.hpp,注释#include“boost/regex.hpp”
//#include <boost/regex.hpp>
错误4: error C1083: 无法打开源文件: “..\..\src\caffe\3rdparty\hungarian.cpp”: No such file or directory E:\caffe-ssd-microsoft\windows\libcaffe\c1xx libcaffe
解决:在路径.\caffe-master\include\caffe\3rdparty\下添加hungarian.h文件。编译项目,报错:找不到".\src\caffe\3rdparty\hungarian.cpp"文件,在路径.\caffe-master\src\caffe\3rdparty\下添加hungarian.cpp文件
在这里找这个文件,链接:http://pan.baidu.com/s/1mhYuf7y 密码:3jp2
错误5:编译项目,报与thrust相关的错误,进入项目libcaffe中,注释掉
#include "thrust/functional.h"
#include "thrust/sort.h"
……
thrust::sort_by_key(&confidences[0], &confidences[0] + num_remain, &idx[0],
thrust::greater<Dtype>());