I am trying to do a timeseries forecasting and the training is going smoothly but passing the same dataset to predict function I'm getting the following error.
InvalidArgumentError: Specified a list with shape [1,1] from a tensor with shape [32,1] [[node sequential/lstm/TensorArrayUnstack/TensorListFromTensor ]] [Op:__inference_predict_function_55827] Function call stack: predict_function
I'm using a Statefull Lstm and same code and model works fine in tensorflow v1.14 but not in tensorflow v2.4.
my X_train.shape,y_train.shape is ((6191, 10, 1), (6191, 1)), X_test.shape=(6191, 10, 1) and batch_size=1
model = Sequential()
model.add(LSTM(10,batch_input_shape=(batch_size, int(i_shape[0]), int(i_shape[1])),
activation=activation,stateful=True,
kernel_regularizer=L1L2(0.01,0.001)))
Model: "sequential_6"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
lstm_11 (LSTM) (1, 10) 480
_________________________________________________________________
dense_4 (Dense) (1, 1) 11
=================================================================
Total params: 491
Trainable params: 491
Non-trainable params: 0
_________________________________________________________________
None
Let me know if any additional information is required.