By default an LSTM model returns only the output of last timestep. ```` model = Sequential() model.add(LSTM(hidden_nodes, input_shape=(n_timesteps, n_features))) ##output shape is (n_features) ```` So the below step is needed to repeat the output vector 'n' number of times where 'n' should be the number of time-steps ```` model.add(RepeatVector(n_timesteps)) ##now shape becomes (n_timesteps,n_features) ```` But when you specify '*return_sequences=True*', LSTM returns a hidden state for ALL timesteps. The output shape from the LSTM directly is (n_timesteps,n_features). So you DONT need to to a 'Repeat Vector' So to eliminate the error, just remove line 4