title: NotImplementedError: Cannot convert a symbolic Tensor to a numpy array
body: <p>The code below used to work last year, but updates in keras/tensorflow/numpy broke it. It now outputs the exception below. Does anyone know how to make it work again?</p>
  <p>I'm using:</p>
  <ul>
  <li>Tensorflow 2.4.1</li>
  <li>Keras 2.4.3</li>
  <li>Numpy 1.20.1</li>
  <li>Python 3.9.1</li>
  </ul>
  <pre><code>import numpy as np
  from keras.layers import LSTM, Embedding, Input, Bidirectional
  
  dim = 30
  max_seq_length = 40
  vecs = np.random.rand(45,dim)
  
  input_layer = Input(shape=(max_seq_length,))
  embedding_layer = Embedding(len(vecs), dim, weights=[vecs], input_length=max_seq_length, trainable=False, name=&quot;layerA&quot;)(input_layer)
  lstm_nobi = LSTM(max_seq_length, return_sequences=True, activation=&quot;linear&quot;, name=&quot;layerB&quot;)
  lstm = Bidirectional(lstm_nobi, name=&quot;layerC&quot;)(embedding_layer)
  </code></pre>
  <p>Complete output of the script above: <a href="https://pastebin.com/DsQNWVwz" rel="noreferrer">https://pastebin.com/DsQNWVwz</a></p>
  <p>Shortened output:</p>
  <pre><code>2021-02-10 17:51:13.037468: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set
  2021-02-10 17:51:13.037899: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  SSE3 SSE4.1 SSE4.2 AVX AVX2 FMA
  To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
  2021-02-10 17:51:13.038418: I tensorflow/core/common_runtime/process_util.cc:146] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
  Traceback (most recent call last):
    File &quot;/run/media/volker/DATA/configruns/load/./test.py&quot;, line 13, in &lt;module&gt;
      lstm = Bidirectional(lstm_nobi, name=&quot;layerC&quot;)(embedding_layer)
    ... omitted, see pastebin ...
    File &quot;/usr/lib/python3.9/site-packages/tensorflow/python/framework/ops.py&quot;, line 852, in __array__
      raise NotImplementedError(
  NotImplementedError: Cannot convert a symbolic Tensor (layerC/forward_layerB/strided_slice: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
  </code></pre>