def _load_layer_types(prototxt):
# Read prototxt with caffe protobuf definitions
layers = caffe_pb2.NetParameter()
with open(prototxt, 'r') as f:
text_format.Merge(str(f.read()), layers)
# Assign layer parameters to type dictionary
types = OrderedDict()
for i in range(len(layers.layer)):
types[layers.layer[i].name] = layers.layer[i].type
return types
评论列表
文章目录