LSTM input size

I want to add an LSTM layer to my sequential model, Below is what I have done My input data has dimensions of 792 X 8. And I am extracting 5 features out of it. I am getting the error “Input 0 of layer “lstm” is incompatible with the layer: expected ndim=3, found ndim=2. Full shape received: (None, 5)” regarding the input arguments to LSTM model. Any help or guidance will be greatly appreciated.

Thanks

model = Sequential([
    LayerNormalization(center=True , scale=True, 
                       input_shape=(shape_input,)),
    Dense(
        units = 512, kernel_initializer = 'he_normal', activation='relu'),
    Dropout(0.3),
    Dense(
        units = 1024, kernel_initializer = 'he_normal', activation='relu'),
    Dropout(0.3),
    Dense(
        units = 2048, kernel_initializer = 'he_normal', activation='relu'),
    Dropout(0.3),
    Dense(
        units = 4096, kernel_initializer = 'he_normal', activation='relu'),
    Dropout(0.3),
    Dense(
        units = 4096, kernel_initializer = 'he_normal', activation='relu'),
    Dropout(0.3),
    Dense(
        units = 2048, kernel_initializer = 'he_normal', activation='relu'),
    Dropout(0.3),
    Dense(
        units = 1024, kernel_initializer = 'he_normal', activation='relu'),
    Dropout(0.3),
    Dense(
        units = 512, kernel_initializer = 'he_normal', activation='relu'),
    Dropout(0.3),
    Dense(
        units = 256, kernel_initializer = 'he_normal', activation='relu'),
    Dropout(0.3),
    Dense(units = num_output, activation='softmax')
])
model.add(LSTM(1, input_shape=(8,792,5)))
model.compile(optimizer='adam',
              loss='categorical_crossentropy',
              metrics = ['accuracy'])
return model

Hi @Rauf_Anwar

Welcome to the TensorFlow Forum!

What is the dataset type and shape? You mentioned the dataset shape (792*8), but you have given input_shape=(8,792,5) in the model which is not matching with the existing dataset.

You need to preprocess the dataset if you want to use only 5 features of the dataset and mention the same input_shape in the model and feed the same preprocessed dataset for model training.

Please provide the standalone code if it is shareable to replicate and fix the error.