如何在 C++ 中获取图层类型的 caffe

How can I get layer type caffe in c++

是否有可能得到每一个

1) 层的类型(例如:卷积、内积、数据等)

2) c++ 中图层的顶部标签(例如:ip1、ip2、conv1、conv2)?

我搜索了提供的示例,但找不到任何内容。目前我只能通过以下命令获取图层名称

cout << "Layer name:" << "'" << net_->layer_names()[layer_index]

我正在搜索像 net_->layer_type

这样的命令

提前致谢!

Layer class 有一个 public 成员函数 virtual const char *type() 返回图层类型。因此

cout << "Layer type: " << net_->layers()[layer_index]->type();

应该可以解决问题。