def get_idx_first_conv(model):
  """Returns the index of the first convolutional
  layer found """
  first_conv_idx = None
  for layer_idx,layer in enumerate(model.layers):
    if 'conv' in layer.name:
      first_conv_idx = layer_idx
      break
  return first_conv_idx