Understanding LSTM input shape for keras I am learning about the LSTM network. The input needs to be 3D. So I have a CSV file which has 9999 data with one feature only. So it is only one file.

So usually it is (9999,1) then I  reshape with time steps 20 steps 

timesteps = 20
dim = data.shape[1]
data.reshape(len(data),timesteps,dim)


but I am getting following error 


  ValueError: cannot reshape array of size 9999 into shape (9999,20,1)


and the input in LSTM

model.add(LSTM(50,input_shape=(timesteps,dim),return_sequences=True, activation="sigmoid"))
(9999,1) has 9999*1 elements = 9999. However, (9999,20,1) will have 9999*20*1 elements, which are not available. Break your data into a batch/sequence length of say 99.
Then reshape it into (101,99,1)