这是由于在net.hpp中缺少net的无参数构造函数,所以添加默认构造函数即可。
class Net { public: explicit Net(); explicit Net(const NetParameter& param, const Net* root_net = NULL); explicit Net(const string& param_file, Phase phase, const int level = 0, const vector<string>* stages = NULL, const Net* root_net = NULL); virtual ~Net() {} .... }
net.cpp中添加以下代码
namespace caffe { template <typename Dtype> Net<Dtype>::Net() : root_net_(NULL) { }