title: How to get CNN kernel values in Tensorflow
body: <p>I am using the code below to create CNN layers.</p>
  
  <pre><code>conv1 = tf.layers.conv2d(inputs = input, filters = 20, kernel_size = [3,3],
      padding = "same", activation = tf.nn.relu)
  </code></pre>
  
  <p>and I want to get the values of all kernels after training. It does not work it I simply do</p>
  
  <pre><code>kernels = conv1.kernel
  </code></pre>
  
  <p>So how should I retrieve the value of these kernels? I am also not sure what variables and method does conv2d has since tensorflow don't really tell it in conv2d class.</p>