title: tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead
body: <pre><code>from tensorflow.keras.applications import VGG16
  from tensorflow.keras import backend as K
  
  model = VGG16(weights='imagenet',
                include_top=False)
  
  layer_name = 'block3_conv1'
  filter_index = 0
  
  layer_output = model.get_layer(layer_name).output
  loss = K.mean(layer_output[:, :, :, filter_index])
  
  grads = K.gradients(loss, model.input)[0]
  </code></pre>
  <p>I am unable to execute <code>grads = K.gradients(loss, model.input)[0]</code>, it generates an error : <code>tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead</code></p>