0

Hi every one i am using pytorch to text classification, for first time i used the number of 44 data for train and the number of 22 for test data, my vocab-size is 531, and my lstm parameters are shown below, but at last in embedding i get this error:

IndexError: index out of range in self

I tried different embed_size, but not worked, can you help me?

Thanks

# LSTM parameters
embed_size =300
hidden_size = 256
num_layers = 1

# training parameters
lr = 0.001
num_epochs = 10
  • Can you share a Minimum Reproducible Example (https://stackoverflow.com/help/minimal-reproducible-example) and add your pytorch code? – arabinelli Oct 24 '20 at 07:18
  • My codes and exact problem is in this link: https://stackoverflow.com/questions/64470080/indexerror-index-out-of-range-in-self – elham soochi Oct 24 '20 at 13:42
  • I looked at your other question and this error doesnt have anything to do with your LSTM hyperparameters. The error message tells you that the problem is in the nn.embedding function of pytroch. So you should investigate that – Theodor Peifer Oct 24 '20 at 19:03

0 Answers0