I best guess would be that your input sequences contain indexes that not match with the embedding layer. The embedding layer has a shape of (vocabulary_size, embedding_dim), e.g., (20000, 300). This means your input sequences can only contain values in the range [0..19999]. You might want to check if any value in your input sequences is 20000 or higher.