farizrahman4u / recurrentshop

Framework for building complex recurrent neural networks with Keras
MIT License
765 stars 218 forks source link

TypeError: can only concatenate tuple (not "int") to tuple #110

Open w5688414 opened 5 years ago

w5688414 commented 5 years ago

errors occur when I use the example code: `from recurrentshop import from keras.layers import from keras.models import Model

input = Input((5,)) state1_tm1 = Input((10,)) state2_tm1 = Input((10,)) state3_tm1 = Input((10,))

lstm_output, state1_t, state2_t = LSTMCell(10)([input, state1_tm1, state2_tm1]) gru_output, state3_t = GRUCell(10)([input, state3_tm1])

output = add([lstm_output, gru_output]) output = Activation('tanh')(output)

rnn = RecurrentModel(input=input, initial_states=[state1_tm1, state2_tm1, state3_tm1], output=output, final_states=[state1_t, state2_t, state3_t])` does anyone can help me? my keras version is 2.2,ubuntu 16.04,python3

anny0316 commented 4 years ago

I also encountered the same problem, how to solve?

RSLLES commented 3 years ago

This issue is still open today, even with a fresh environnement. Does anyone knows how to solve this ?

RSLLES commented 3 years ago

Got it guys, keras also have layers called GRUCell and LSTMCell, and the line "from keras.layers import *" overwrites the one imported from recurrentshop.

You should consider swapping both "from keras.layers import " and "from recurrentshop import ".

Issue Closed.