Ganesh M S
Ganesh M S

Reputation: 1063

How can I get layer type caffe in c++

Is it possible get each

1) layer's type (e.g: Convolution,InnerProduct ,Data, etc)

2) the layer's top labels (e.g: ip1,ip2,conv1,conv2) in c++?

I searched the examples provided, but I couldn't find anything. currently I'm abel to get only the layers names by the following command

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

I'm searching for some command like net_->layer_type

Thankyou in advance!

Upvotes: 3

Views: 286

Answers (1)

Ari Hietanen
Ari Hietanen

Reputation: 1769

The Layer class has a public member function virtual const char *type() returning the layer type. Hence

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

should do the trick.

Upvotes: 1

Related Questions