farizrahman4u / seq2seq

Sequence to Sequence Learning with Keras
GNU General Public License v2.0
3.17k stars 846 forks source link

add seq2seq layer to embedding layer with mask raise "Exception: Layers should have equal number of output tensors and output masks. Layer recurrent_sequential_1 has 3 output tensors and 4 output masks." #270

Open shelfee opened 5 years ago

shelfee commented 5 years ago

model = Sequential() model.add(Embedding(39, 39, input_length=24, mask_zero=True)) model.add(Seq2Seq(input_length=24, input_dim=39, hidden_dim=10, output_length=22, output_dim=39)) raise the Exception

ketyi commented 5 years ago

I've the exact same Exception with an ultra simple: base_model = Seq2Seq(input_dim=128, input_length=150, hidden_dim=512, output_length=150, output_dim=128, depth=2) multi_model = multi_gpu_model(base_model, gpus=2) multi_model.compile(loss='mse', optimizer='adam', metrics=['mse'])

I don't have any masks and with the AttentionSeq2Seq class just worked...

foreshadow commented 5 years ago

Same issue.

byamao1 commented 4 years ago

I encounter this problem too.

Lance-Tin commented 1 year ago

I encounter this problem too. just executed the example code; tensorflow==1.13.1 keras==2.2.4 python==3.6.2