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新手
“Exception: Input 0 is incompatible with layer lstm_28: expected ndim=3, found ndim=2” ,出现这个错误,应该在当前层 的上一层中添加return_sequences=True这个参数,使其返回ndim=3的序列
如果问题得到解决,麻烦点下我回答右边的采纳,谢谢