caffe 调试 cascade网络时 no matching function for call to ‘caffe::Net<float>::Net()’

这是由于在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) {
}

 

posted @ 2017-06-10 15:55  一步倾尘  阅读(1452)  评论(0编辑  收藏  举报