1. “tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[14,0] = 12388 is not in [0, 112288]”
原因: tf.keras.layers.Embedding()中,vocab_size 设置比实际小。
===============================================
2. " Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray)"
原因: model.fit() 中,输入的shape 与模型构建时的shape不一样。例如: 实际模型构建如下为 [(None, 15)]。 但是fit中,shape为(10000, ).
修改: fit中的shape,改为(10000, 15)