net = caffe.Net(model_filename, weight_filename, caffe.TEST)
net.layers[0]. ???
import caffe
from google.protobuf import text_format
net_config = caffe.proto.caffe_pb2.NetParameter()
train_file = "/path/to/file/train.prototxt"
file = open(train_file, "r")
text_format.Merge(str(file.read()), net_config)
file.close()
# At this point you can access the layer information from the net_config object
# For example get all the layers in the network with:
layer_list = net_config.layer
# View all the layers with protobuf formatting:
for layer in layer_list:
print(layer)
# Assuming layer 5 is a convolution parameter you can access the num_output parameter with:
conv_num_out = layer_list[5].convolution_param.num_output