Tensoflow throws error and I dont know how to fix it

Hello there,
Im currently stuck with a code cause I’m not able to fix the error.
I currently build a neural network but something seems to be wrong with the input which is an array containing 10000 arrays with the length 1024(after train test split there are just 7000 arrays left as training features). Here is the code:

# load and prepare dataset def get_data(filename): dataset = pd.read_parquet(filename) # features = dataset.iloc[:,0] features = np.stack(dataset['spectrum']) print(features) labels = dataset.iloc[:, 1] x_train, x_test, y_train, y_test = train_test_split(features, labels, test_size=0.30, random_state=43) # get input shape input_shape = x_train.shape return x_train, x_test, y_train, y_test, input_shape # implement neural network def build_model(input_shape, loss_function, metrics, learning_rate): model = Sequential() model.add(InputLayer(input_shape=input_shape)) model.add(Dense(64, activation="relu")) model.add(Dense(128, activation="relu")) model.add(Dense(64, activation="relu")) model.add(Dense(1)) model.compile(loss=loss_function, metrics=metrics, optimizer=Adam(learning_rate=learning_rate)) return model # fit and evaluate def fit_evaluate(model, epochs, batch_size, x_train, x_test, y_train, y_test): stop = EarlyStopping(monitor='val_loss', mode='min', verbose=1, patience=10) model.fit(x_train, y_train, epochs=epochs, batch_size=batch_size, verbose=1, validation_split=0.2, callbacks=[stop]) val_mse, val_mae = model.evaluate(x_test, y_test, verbose=0) return val_mse, val_mae, model # hyper parameters learning_rate = 0.01 loss_function = "mse" metrics = ["mae"] epochs = 100 batch_size = 28 x_train, x_test, y_train, y_test, input_shape = get_data("spectrum_data.parquet") model = build_model(input_shape, loss_function, metrics, learning_rate) val_mse, val_mae, model = fit_evaluate(model, epochs, batch_sizThis text will be hiddene, x_train, x_test, y_train, y_test) print(f"Mean squared error = {val_mse}, mean absolute error = {val_mae}") **strong text** model.save("concentration_prediction_model.h5")

it raises following error:

Traceback (most recent call last): File "C:/Users/#/Desktop/Python Projects/gas_concentration_prediction/deep_learning_models.py", line 68, in <module> val_mse, val_mae, model = fit_evaluate(model, epochs, batch_size, x_train, x_test, y_train, y_test) File "C:/Users/#/Desktop/Python Projects/gas_concentration_prediction/deep_learning_models.py", line 51, in fit_evaluate model.fit(x_train, y_train, epochs=epochs, batch_size=batch_size, verbose=1, validation_split=0.2, callbacks=[stop]) File "C:\Users\#\Desktop\Python Projects\gas_concentration_prediction\venv\lib\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler raise e.with_traceback(filtered_tb) from None File "C:\Users\#\Desktop\Python Projects\gas_concentration_prediction\venv\lib\site-packages\tensorflow\python\framework\func_graph.py", line 1129, in autograph_handler raise e.ag_error_metadata.to_exception(e) ValueError: in user code: File "C:\Users\#\Desktop\Python Projects\gas_concentration_prediction\venv\lib\site-packages\keras\engine\training.py", line 878, in train_function * return step_function(self, iterator) File "C:\Users\#\Desktop\Python Projects\gas_concentration_prediction\venv\lib\site-packages\keras\engine\training.py", line 867, in step_function ** outputs = model.distribute_strategy.run(run_step, args=(data,)) File "C:\Users\#\Desktop\Python Projects\gas_concentration_prediction\venv\lib\site-packages\keras\engine\training.py", line 860, in run_step ** outputs = model.train_step(data) File "C:\Users\#\Desktop\Python Projects\gas_concentration_prediction\venv\lib\site-packages\keras\engine\training.py", line 808, in train_step y_pred = self(x, training=True) File "C:\Users\#\Desktop\Python Projects\gas_concentration_prediction\venv\lib\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler raise e.with_traceback(filtered_tb) from None File "C:\Users\#\Desktop\Python Projects\gas_concentration_prediction\venv\lib\site-packages\keras\engine\input_spec.py", line 263, in assert_input_compatibility raise ValueError(f'Input {input_index} of layer "{layer_name}" is ' ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 7000, 1024), found shape=(28, 1024)

mabey someone knows why and how to fix it, would be great!