Unrecognized keyword arguments passed to Embedding
Ok I tried converting the input_length to input_shape of(10,) formulating what it was trying to say in the documentation. (On searching I found this). But shouldn't that be updated in documentation as well? ValueError: Unrecognized keyword arguments passed to Embedding: {'input_length': 10}
how to solve this error Instead of input length:10 I used input_shape=(10,) to reproduce the same effect. It worked for me. But when u read the documentation u won't find anything like input_shape you would only find input_length.  Hi **@theraghavjuneja** ,
Sorry for the delay, I tried to run your code on Colab using TF v2.16.1, nightly and faced the same issue. Please find the [gist](https://colab.sandbox.google.com/gist/Venkat6871/99ce9eb697012021b325ca1c1e7f5b00/64252_2-16-1-nightly-v.ipynb) here for reference.

Thank you! Hi **@theraghavjuneja** ,
The error occurs because the Embedding layer in TensorFlow 2.x does not have an input_length argument. This argument was removed in version 2.0.0 of TensorFlow.

To fix this error, you need to remove the input_length argument from the Embedding layer. The input_length argument is used to specify the maximum length of the input sequences. However, in TensorFlow 2.x, the Embedding layer automatically infers the input length from the input data. Please find the [gist](https://colab.sandbox.google.com/gist/Venkat6871/fcbd5a333c8a32a7ef57c883ed513c96/64252_2-16-1.ipynb) here for reference. > Instead of input length:10 I used input_shape=(10,) to reproduce the same effect. It worked for me. But when u read the documentation u won't find anything like input_shape you would only find input_length.

I created an LSTM-based sequential model for text generation. I updated my keras to 3.1.1 and had the same issue.  Using `input_shape=(25,)` worked for my model. Thanks.  Hi @TomBerton : I am hitting this same issue  with TF==2.16  version for my CNN Word2Vector Embeddings

# Define the CNN model
model = Sequential()
model.add(Embedding(vocab_size, 100, weights=[embedding_matrix],input_length=max_length, trainable=False))
model.add(Conv1D(128, 5, activation='relu'))

(DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % 
(DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % pip list | grep  Tensroflow
(DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % 
(DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % pip list | grep  Tensorflow 
]%                                                                                                                                                                                                              (DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % ]
zsh: command not found: ]
(DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % pip list | grep  tensorflow
tensorflow                   2.16.1
tensorflow-datasets          4.9.4
tensorflow-estimator         2.12.0
tensorflow-io-gcs-filesystem 0.36.0
tensorflow-metadata          1.14.0
(DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % 
(DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % pip list | grep keras      
keras                        3.1.1
tf_keras                     2.16.0
(DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 %  > Hi @TomBerton : I am hitting this same issue with TF==2.16 version for my CNN Word2Vector Embeddings
> 
> # Define the CNN model
> model = Sequential() model.add(Embedding(vocab_size, 100, weights=[embedding_matrix],input_length=max_length, trainable=False)) model.add(Conv1D(128, 5, activation='relu'))
> 
> (DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % (DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % pip list | grep Tensroflow (DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % (DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % pip list | grep Tensorflow ]% (DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % ] zsh: command not found: ] (DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % pip list | grep tensorflow tensorflow 2.16.1 tensorflow-datasets 4.9.4 tensorflow-estimator 2.12.0 tensorflow-io-gcs-filesystem 0.36.0 tensorflow-metadata 1.14.0 (DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % (DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % pip list | grep keras keras 3.1.1 tf_keras 2.16.0 (DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 %

(DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % python CNN_WordVec.py
Traceback (most recent call last):
  File "/Users/akram_personal/AKRAM_CODE_FOLDER/DS_EXERCISES/DS_2024/CNN_WordVec.py", line 114, in <module>
    model.add(Embedding(vocab_size, 100, weights=[embedding_matrix], trainable=False))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/envs/DS/lib/python3.11/site-packages/keras/src/layers/core/embedding.py", line 81, in __init__
    super().__init__(**kwargs)
  File "/opt/anaconda3/envs/DS/lib/python3.11/site-packages/keras/src/layers/layer.py", line 264, in __init__
    raise ValueError(
ValueError: Unrecognized keyword arguments passed to Embedding: {'weights': [array([[0., 0., 0., ..., 0., 0., 0.],
       [0., 0., 0., ..., 0., 0., 0.],
       [0., 0., 0., ..., 0., 0., 0.],
       ...,
       [0., 0., 0., ..., 0., 0., 0.],
       [0., 0., 0., ..., 0., 0., 0.],
       [0., 0., 0., ..., 0., 0., 0.]])]}
(DS) akram_personal@AKRAMs-MacBook-Pro DS_2024 % 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/64252">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/64252">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

v2.16.0-rc0-18-g5bc9d26649c 2.16.1

### Custom code

Yes

### OS platform and distribution

Windows 11

### Mobile device

_No response_

### Python version

3.11.5

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Ok so if i head over to the tensorflow documentation of Embeddings layer, as a sample code they show me something like this
Example:

>>> model = keras.Sequential()
>>> model.add(keras.layers.Embedding(1000, 64, input_length=10))
But when I try to reproduce the same code (asitis ) or in my another Sequential model it would always show Unrecognized keyword arguments passed to Embedding: {'input_length': 10}
Is the documentation not updated? or this thing has been removed or it is a bug since I have tried replacing it with some other keyword argument I found over stackoverflow but nothing worked for me

### Standalone code to reproduce the issue

```shell
model=Sequential()
model.add(keras.layers.Embedding(vocab_size,embedded_vector_size,input_length=max_length))
model.add(Flatten())
model.add(Dense(1,activation='sigmoid'))
```


### Relevant log output

```shell
----> 8 model.add(keras.layers.Embedding(vocab_size,embedded_vector_size,input_length=max_length))
      9 model.add(Flatten())
     10 model.add(Dense(1,activation='sigmoid'))
File c:\Users\Charanjeet Juneja\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\src\layers\core\embedding.py:81, in Embedding.__init__(self, input_dim, output_dim, embeddings_initializer, embeddings_regularizer, embeddings_constraint, mask_zero, lora_rank, **kwargs)
     70 def __init__(
     71     self,
     72     input_dim,
   (...)
     79     **kwargs,
     80 ):
---> 81     super().__init__(**kwargs)
     82     self.input_dim = input_dim
     83     self.output_dim = output_dim

File c:\Users\Charanjeet Juneja\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\src\layers\layer.py:265, in Layer.__init__(self, activity_regularizer, trainable, dtype, autocast, name, **kwargs)
    263     self._input_shape_arg = input_shape_arg
    264 if kwargs:
...
    268     )
    270 self.built = False
    271 self.dtype_policy = dtype_policies.get(dtype)

ValueError: Unrecognized keyword arguments passed to Embedding: {'input_length': 10}
```
