When I train a RNN with Pytorch with batch-size over 2, this error is raised: "RuntimeError: INDICES element is out of DATA bounds, id=23 axis_dim=1"

However, when batch_size is set less than 3, the code can run well and the RNN can be trained.

The error occurs at this code: "out, hidden_prev = self.rnn(x, hidden_prev)"

By the way, it seems not to be related to CPU Memory because the error is raised on different computers.

More Zhenhao Jiang's questions See All
Similar questions and discussions