這是由於在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) { }