今天又遇到学习keras的一个坑,ValueError: Invalid reduction dimension 2 for input with 2 dimensions. for 'model_3/sequential_2/lstm_4/Sum' (op: 'Sum') with input shapes: [?,100], [2] and with computed input tensors: input[1] = <1 2>.
翻译过来的意思大致是:输入数据的维度与模型的输入维度不对应。然后系统还提示了输入错误的位置:'model_3/sequential_2/lstm_4/
一般这种问题就是你的输入数据维度和大小之类的和你定义模型的需要输入的维度大小等不一致。但是,这种不一致的原因有很多种,不能具体说明什么原因。