Yeah, I find it. The size of vocab in max_embedding layer should be maximum index + 1 but mine is maximum index.
But why the Traceback indicate the error in other line of if USE_CUDA: item = item.cuda() over show the line of max_embedding = self.max_embedding(max)?