InvalidArgumentError: Graph execution error: ndices[15,287] = 6368 is not in [0, 1993)
Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60669">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60669">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Others

### Have you reproduced the bug with TF nightly?

No

### Source

source

### Tensorflow Version

tf 2.10.0

### Custom Code

Yes

### OS Platform and Distribution

Windows

### Mobile device

_No response_

### Python version

3.10.8

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

I have been searching for a solution to this error, and I have tried changing the input dimension, but it is still not working. I would appreciate it if you could help me troubleshoot this issue.
Getting this error:
![image](https://github.com/tensorflow/tensorflow/assets/72642816/d0d3d78f-df1e-4b39-8a8a-e697791d4195)


### Standalone code to reproduce the issue

```python
# Embedding dimensions: depends on the word embedding vector dimension (300)
EMBEDDING_DIM = 300
# How many unique words to use (i.e number of rows in embedding vector)
MAX_VOICAB_SIZE = 20000
# Maximum number of words for each row of comment
MAX_SEQUENCE_LENGTH = 300

# Training Parameters
BATCH_SIZE = 256
EPOCHS = 2

sequence = df_test['cleaned'].apply(lambda x: [token.lex_id if not token.is_oov else 0 for token in nlp(x)]).to_list()
# By default, setting max length of paddings will truncate any sequences that are longer than the max length
x_train = pad_sequences(sequence, maxlen=MAX_SEQUENCE_LENGTH)
y_train = label_values
```

```python
tf.keras.backend.clear_session()
# Yoon Kim model (https://arxiv.org/abs/1408.5882)
def createTextCNN(vocab_size, embeddings_weights, max_sequence_length, embedding_dim, num_labels):
    # Input layer
    input_text = Input(shape=(max_sequence_length,)) # TODO Find out the shape

    # Embedding layer

    embedded_sequences = Embedding(
                input_dim=vocab_size
                , output_dim=embedding_dim
                , weights=[embeddings_weights]
                , input_length=max_sequence_length
                , trainable=False
                )(input_text)

    pool_output = []
    kernel_sizes = [3, 4, 5]
    for size in kernel_sizes:
        conv = Conv1D(filters=128, kernel_size=size)(embedded_sequences)
        pool = MaxPooling1D(pool_size=int(conv.shape[1]))(conv)
        pool_output.append(pool)

    pool_output = concatenate([pool for pool in pool_output])
    dropout_out = Dropout(0.5)(pool_output)
    flat_layer = Flatten()(dropout_out)
    x = Dense(units=128, activation='relu')(flat_layer)
    dropout_out = Dropout(0.2)(x)

    output_layer = Dense(units=num_labels, activation='sigmoid')(dropout_out)

    model = Model(input_text, output_layer)

    return model

model = createTextCNN(len(counter)
        , embedding_weights
        , MAX_SEQUENCE_LENGTH
        , EMBEDDING_DIM
        , len(LABELS))

model.summary()
```

```python
model.compile(loss='categorical_crossentropy',
            optimizer='adam',
            metrics=['accuracy'])

early_stopping = EarlyStopping(monitor='val_loss', min_delta=0.01, patience=4, verbose=1)
callbacks_list = [early_stopping]

train = model.fit(x_train, y_train, epochs=EPOCHS, shuffle=True, batch_size=BATCH_SIZE, callbacks=callbacks_list)
```
```


### Relevant log output

_No response_</details>