Skip to content Skip to sidebar Skip to footer

Why In ConvLSTM When Setting Return_sequence = False You Get An Error?

I have tried to model by attached three layer of ConvLSTM but when I set in the first ConvLSTM return_sequence = False program won't run. See the model summary Model summary The mo

Solution 1:

If return_sequence is true, it means the LSTM layer will return the full sequence of the output not only the final output. So the input of next layer is still time sequence, it also means the next layer MUST be RNN to handle time sequence.

If return_sequence is false, it means the LSTM layer will ONLY return the final output, which is not a time sequence any more. So the dimension will be reduced one. For your example, it will be changed from 5 to 4. And because the input for next layer is not time sequence anymore, the next layer MUST NOT be RNN any more.


Solution 2:

When you set the parameter return_sequence = False, only one vector is returned after that, which does not satisfy the input dimension requirements of the next layer. This causes the program not to run. When you select true, a sequence is returned so that your timestep dimension does not disappear.


Post a Comment for "Why In ConvLSTM When Setting Return_sequence = False You Get An Error?"