brighteningeyes:

so, the shape for RNN should be [channels, batch_size, width*height]?


No, in the default setup, this shapes is expected:



 ptrblck:

nn.RNN expects an input tensor in the shape [seq_len, batch_size, features] in the default setup as described in the docs.


If you want to use the pixels as the temporal dimension, you would have to permute them to dim0.
Note that you could also set batch_first during the creation of the RNN, which would then expect the input in the shape [batch_size, seq_len, features].