InvalidArgumentError: indices[16,16] = -1 is not in [0, 6766) 报错怎么解决?

InvalidArgumentError: indices[16,16] = -1 is not in [0, 6766)
     [[{{node embedding_19/embedding_lookup}} = GatherV2[Taxis=DT_INT32, Tindices=DT_INT32, Tparams=DT_FLOAT, _class=["loc:@training_13/Adam/Assign_2"], _device="/job:localhost/replica:0/task:0/device:CPU:0"](embedding_19/embeddings/read, embedding_19/Cast, training_13/Adam/gradients/embedding_19/embedding_lookup_grad/concat/axis)]]

 

求大神指点。

embedder = Embedding(input_dim = vocabulary_size+1,output_dim = embedding_dim,input_length = sequence_length)(main_input)

model.fit(X_train,y_train,batch_size = batch_size,epochs = epochs,verbose = 1,callbacks = [checkpoint],validation_data = (X_test,y_test))
 

vocabulary_size+1,加了1还是报同样的错。

 

 

解决办法,检查输入数据的格式即可。

你可能感兴趣的:(InvalidArgumentError: indices[16,16] = -1 is not in [0, 6766) 报错怎么解决?)