Traceback (most recent call last):
File "LSTM_att/co-attention.py", line 98, in
img_new_repeat = RepeatVector(maxlen)(img_new_dense)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 529, in call
self.assert_input_compatibility(x)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 469, in assert_input_compatibility
str(K.ndim(x)))
ValueError: Input 0 is incompatible with layer repeatvector_2: expected ndim=2, found ndim=3
求助,帮忙keras新手
repeatvector_2: expected ndim=2, found ndim=3
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- threenewbee 2017-12-14 04:08关注
“Exception: Input 0 is incompatible with layer lstm_28: expected ndim=3, found ndim=2” ,出现这个错误,应该在当前层 的上一层中添加return_sequences=True这个参数,使其返回ndim=3的序列
解决 无用评论 打赏 举报