LSTM error ValueError: Unexpected result of `train_function` (Empty logs). Please use `Model.compile(..., run_eagerly=True)`, or `tf.config.run_functions_eagerly(True)` for more information of where went wrong, or file a issue/bug to `tf.keras`




I am having trouble trying to fit my model. I get the following error: ValueError: Unexpected result of train_function (Empty logs). Please use Model.compile(..., run_eagerly=True), or tf.config.run_functions_eagerly(True) for more information of where went wrong, or file a issue/bug to tf.keras.

What can I change in my code to fix this error? Is my model not being fitted properly?

I am trying to use a multivariate LSTM model to predict future sales by SKU. I am using various features for this prediction. Here is snippets of my code for a better understanding of my train and test shape and the error.

Hi @Mri

Welcome to the TensorFlow Forum!

It seems there is input shape mismatch error and the units in the final Dense layer of the model which can cause above error. You have shown the input_shape for X_train=(7355,2630) but the defined model expect the input_shape=(None, 2, X.shape[2].

Please provide us few details like what is the shape of the train_X, train_y, val_X and val_y and how many classes are present in the dataset to understand the issue. Thank you.