title: Keras - get weight of trained layer
body: <p>I'm trying to get the values of a layer in a trained network. I can get the layer as a TensorFlow Tensor, but I'm unable to access its values in an array shape:</p>
  
  <pre><code>from keras.models import load_model
  
  model = load_model('./model.h5')
  layer_dict = dict([(layer.name, layer) for layer in model.layers])
  
  layer_name = 'block5_sepconv1_act'
  filter_index = 0
  
  layer_output = layer_dict['model_1'][layer_name].output
  # &lt;tf.Tensor 'block5_sepconv1_act/Relu:0' shape=(?, 16, 16, 728) dtype=float32&gt;
  layer_filter = layer_output[:, :, :, filter_index]
  # &lt;tf.Tensor 'strided_slice_11:0' shape=(?, 16, 16) dtype=float32&gt;
  # how do I get the 16x16 values ??
  </code></pre>