farizrahman4u / seq2seq

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

Cannot import seq2seq #191

Closed Blockost closed 7 years ago

Blockost commented 7 years ago

Hi,

I can't import the seq2seq library. With Keras 1.1.0, I get cannot import name initializers

selection_43

With Keras 2.0.2, I get cannot import name weight

selection_44

I'm using recurrentshop-1.0.0. I tried with recurrentshop-0.0.1 as mentioned in #172 but still got an error.

Does anyone know what I should do to make it work ?

Thanks :+1:

abhaikollara commented 7 years ago

Update seq2seq

Blockost commented 7 years ago

Thanks ! My bad for not updating seq2seq before opening an issue. I had a really old version actually.

However, when I copy paste from the readme the code for the Seq2seq model with attention:

import seq2seq
from seq2seq.models import AttentionSeq2Seq
model = AttentionSeq2Seq(input_dim=5, input_length=7, hidden_dim=10, output_length=8, output_dim=20, depth=4)
model.compile(loss='mse', optimizer='rmsprop')

I got this weird error : Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, 2), (None, 2, 2)]

Any idea to fix this ?

abhaikollara commented 7 years ago

@Blockost I can't reproduce the error, it's working fine for me. Are you sure you pulled the latest commit ?

Blockost commented 7 years ago

Yes, I did pip install git+https://github.com/farizrahman4u/seq2seq.git.

But I actually uninstalled + reinstalled both recurrentshop and seq2seq and now the error is : Dropout' object has no attribute 'is_placeholder' which seems to be related to my version of Keras.

I'm on 2.0.2, which version do you use currently use ?

abhaikollara commented 7 years ago

I'm using 2.0.4, but I really don't think that's the issue

Blockost commented 7 years ago

Yes, it was:

selection_45

Thanks for your help @abhaikollara ! :+1:

voletiv commented 7 years ago

Faced the same problem, resolved by upgrading keras to 2.0.6. Thanks for the help!