For anyone else getting this error: check that you’re not passing in any lookup indices larger than the size of your embedding matrix. This might happen if you’re encoding your input with an additional UNK index but didn’t include in when specifying the size of your embedding layer.