code: def get_layers(proto):
      
      if len(proto.layer):
          return proto.layer
      elif len(proto.layers):
          return proto.layers
      else:
          raise ValueError('Invalid proto file.')
docs: Returns layers in a caffe_pb2.NetParameter object