Solved by ptrblck in post #4 
              
              
                You cannot pass indices higher than embedding_dim-1, since the embedding layer is working as a lookup table. The input is used to index the corresponding embedding vector, so you should set embedding_dim as the highest value you would expect in your use case.