How to write a LSTM model with 3 dimensional X_train and Y_trains? I have X_train and Y_train with [2160,24,3] dimensions. But when I try a simple LSTM like this:

model = Sequential()
model.add(LSTM(24 , return_sequences = True))
model.add(Dropout(dp)) 


It gives me this error message:


  ValueError: Error when checking target: expected dropout_192 to have
  shape (24, 24) but got array with shape (24, 3)


And when I try to change my code like this:

model = Sequential()
model.add(LSTM(24 , return_sequences = False))
model.add(Dropout(dp)) 

model.add(RepeatVector(24))


I get:


  ValueError: Error when checking target: expected repeat_vector_55 to
  have shape (24, 24) but got array with shape (24, 3)


Also:

model = Sequential()
model.add(LSTM(24 , return_sequences = False))
model.add(Dropout(dp))   
model.add(RepeatVector(24))
model.add(TimeDistributed(Dense(1))) 


Or:

model = Sequential()
model.add(LSTM(24 , return_sequences = False))
model.add(Dropout(dp))   
model.add(RepeatVector(24))
model.add(LSTM(24 , return_sequences = True))
model.add(Dropout(dp)) 
model.add(TimeDistributed(Dense(1))) 


Gives me:


  ValueError: Error when checking target: expected time_distributed_56
  to have shape (24, 1) but got array with shape (24, 3)


I am confused and don't know how to fix it? What I want is train a LSTM model with X_train and Y_train of size [2160,24,3]. How can I do that?
In all the above cases, you are not setting the output shape properly. The last layer should create 3 features.
Try this for example:

model = Sequential()
model.add(LSTM(24, return_sequences = True))
model.add(Dropout(dp)) 
model.add(Dense(3))