I am trying to create a very simple 2 layer LSTM model for sequential prediction. The input data shape is 2D. I want to pad my input but I wasn't sure how to do it, so I manually padded my input data. That is why the pad_inputs is commented out. However, when I run this model I get an error saying:
ValueError: Dimensions must be equal, but are 45 and 400 for '{{node lstm_1/while_11/SelectV2}} = SelectV2[T=DT_FLOAT](lstm_1/while_11/Tile, lstm_1/while_11/lstm_cell_35/mul_2, lstm_1/while_11/Placeholder_2)' with input shapes: [?,45], [?,400], [?,400].
inputs = keras.Input(shape=(timesteps, len(paramlist)), dtype="float32")
# pad_inputs = preprocessing.sequence.pad_sequences(X_train_arr, value=-1, padding='post')(inputs)
mask_inputs = Masking(mask_value=-1.)(inputs)
l1 = LSTM(units=400, activation=activation_method_LSTM, use_bias=False, return_sequences=True, name='lstm_1')(inputs, mask=mask_inputs)
l2 = Dropout(0.3)(l1)
l3 = LSTM(units=400, activation=activation_method_LSTM, use_bias=False, return_sequences=True, name='lstm_2')(l2)
l4 = Dropout(0.3)(l3)
outputs = Dense(n_out)(l4)
model = keras.Model(inputs, outputs)
keras.utils.plot_model(model, 'final_approach_prediction_model.png', show_shapes=True)
model.summary()