I wanted to train an RNN on the task of sentiment analysis, for this task I was using the IMDB dataset provided by torchtext which contains 50000 movie reviews and it is a python iterator. I used a split=('train', 'test').
I first built a vocab using torchtext.vocab.Vocab and tokenized each of the sentence and then performed numericalisation.
To pad the sequence to the same length I used torch.nn.utils.rnn.pad_sequence and also used a collate_fn together with batch_sampler. Then I loaded the data using torch.utils.data.DataLoader.
The implementation of the RNN Network is fine but the dataloader is exhausted after a single epoch as you can see in the image attached below.
Am I following the right approach to load this iterable-dataset? and why is the dataloader exhausted after a single epoch and how do I overcome this issue.
Pleases refer to the shared colab notebook if you want to see my implementation.
PS. I was following the official changelog of torchtext from github
You can find my implementation here
