ValueError: Error when checking input: expected encode_input to have shape (20,) but got array with shape (1,)
tf2.0与tf2.0以上不同,直接传入python原数据格式,eg:list会出错,改成np.array(data)
_, result = self.encoder_emb.predict(sens_ids)
改成
_, result = self.encoder_emb.predict(np.array(sens_ids))