title: Invalid argument: indices[207,1] = 1611 is not in [0, 240) - Tensorflow 2.x (Python)
body: <p>I'm using a RNN <strong>LSTM model</strong> to classify personality types. I'm getting an unexpected indices error when I start to train the model. I tried to use some solutions using the tracebacks, but there is no information of this issue using TF 2.0.<br/><br/>
  I will leave my <a href="https://colab.research.google.com/drive/1MTxv4sfntPL1AhrW2DlaQ7HRAUYDV5UN" rel="nofollow noreferrer">Google Colab</a> If you'll like to have a look up.</p>
  
  <p><strong>MODEL:</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>model = keras.Sequential()
  model.add(keras.layers.Embedding(input_dim = 240, output_dim = 64)) # The maxlen of the training and validation data is 240.
  model.add(keras.layers.Bidirectional(keras.layers.LSTM(64)))
  model.add(keras.layers.Dense(64, activation = 'relu'))
  model.add(keras.layers.Dense(16, activation = 'softmax'))
  model.compile(loss='sparse_categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
  model.summary()
  </code></pre>
  
  <p><strong>Training the model:</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>fitModel = model.fit(train_data_padded, train_label_seq,
                       epochs = 10,
                       batch_size = 295, # The length of the data is 295
                       validation_data = (validation_padded, validation_label_seq),
                       verbose = 1)
  </code></pre>
  
  <p><strong>Traceback:</strong></p>
  
  <pre><code>Train on 236 samples, validate on 59 samples
  Epoch 1/10
  236/236 [==============================] - 0s 71us/sample
  ---------------------------------------------------------------------------
  InvalidArgumentError                      Traceback (most recent call last)
  &lt;ipython-input-33-48497b2e653e&gt; in &lt;module&gt;()
        3                                          batch_size = 295, #how many we will load it at once (number of samples per gradient)
        4                                          validation_data = (validation_padded, validation_label_seq), #(x_val, y_val) validation_padded, validation_label_seq
  ----&gt; 5                      verbose = 1)
  
  11 frames
  /usr/local/lib/python3.6/dist-packages/six.py in raise_from(value, from_value)
  
  InvalidArgumentError: 2 root error(s) found.
    (0) Invalid argument:  indices[207,1] = 1611 is not in [0, 240)
       [[node sequential_3/embedding_3/embedding_lookup (defined at &lt;ipython-input-31-bd83004f8334&gt;:5) ]]
    (1) Invalid argument:  indices[207,1] = 1611 is not in [0, 240)
       [[node sequential_3/embedding_3/embedding_lookup (defined at &lt;ipython-input-31-bd83004f8334&gt;:5) ]]
       [[VariableShape/_22]]
  0 successful operations.
  0 derived errors ignored. [Op:__inference_distributed_function_22239]
  
  Errors may have originated from an input operation.
  Input Source operations connected to node sequential_3/embedding_3/embedding_lookup:
   sequential_3/embedding_3/embedding_lookup/20179 (defined at /usr/lib/python3.6/contextlib.py:81)
  
  Input Source operations connected to node sequential_3/embedding_3/embedding_lookup:
   sequential_3/embedding_3/embedding_lookup/20179 (defined at /usr/lib/python3.6/contextlib.py:81)
  
  Function call stack:
  distributed_function -&gt; distributed_function
  </code></pre>