title: Cannot convert a symbolic Tensor to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported
body: <p><code>tensorflow</code> version 2.3.1 <code>numpy</code> version 1.19.5 <code>keras</code> version 2.4.3</p>
  <p>I want to see the middle layer of the <code>keras</code> model.</p>
  <pre><code>train_data = tf.constant([[0, 0], [0, 1], [1, 0], [1, 1]])
  train_labels = tf.constant([[0], [0], [0], [1]])
  input_tensor = Input(shape=2)
  x1 = Dense(10, kernel_initializer=initializer)(input_tensor)
  x2 = Activation('sigmoid')(x1)
  output_tensor = layers.Dense(1, activation='sigmoid', kernel_initializer=initializer)(x2)
  model = Model(inputs=input_tensor, outputs=output_tensor)
  model.summary()
  model.compile(optimizer='adam',
                loss='binary_crossentropy',
                metrics=['acc'])
  print('weight', model.get_weights())
  history = model.fit(train_data, train_labels, epochs=800)
  
  #error
  test = tf.constant(x2)
  print(x2)
  </code></pre>
  <p>we got</p>
  <blockquote>
  <p>NotImplementedError: Cannot convert a symbolic Tensor (activation/Sigmoid:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported</p>
  </blockquote>
  <p>Changing the version of <code>numpy</code> does not solve the problem.</p>