DeepsMoseli / Bidirectiona-LSTM-for-text-summarization-

A bidirectional encoder-decoder LSTM neural network is trained for text summarization on the cnn/dailymail dataset. (MIT808 project)
MIT License
81 stars 36 forks source link

Lstm_attention.py #3

Open sanjayb678 opened 6 years ago

sanjayb678 commented 6 years ago

Line 66 In the encoder_decoder function throws an error, TypeError: list indices must be integers or slices, not tuple.

Let me know if you need more details. Thanks.

abdullahfde commented 5 years ago

Hello, How we can fix this error ?

PratikNalage commented 5 years ago

I'm getting the following error:

Traceback (most recent call last):
  File "lstm_Attention.py", line 195, in <module>
    trained_model,encoder,decoder,history = encoder_decoder(train_data)
  File "lstm_Attention.py", line 101, in encoder_decoder
    decoder_outputs = decoder_dense(attention)
  File "/home/game-of-codes/anaconda3/envs/py3/lib/python3.6/site-packages/keras/engine/base_layer.py", line 431, in __call__
    self.build(unpack_singleton(input_shapes))
  File "/home/game-of-codes/anaconda3/envs/py3/lib/python3.6/site-packages/keras/layers/core.py", line 866, in build
    constraint=self.kernel_constraint)
  File "/home/game-of-codes/anaconda3/envs/py3/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/home/game-of-codes/anaconda3/envs/py3/lib/python3.6/site-packages/keras/engine/base_layer.py", line 249, in add_weight
    weight = K.variable(initializer(shape),
  File "/home/game-of-codes/anaconda3/envs/py3/lib/python3.6/site-packages/keras/initializers.py", line 209, in __call__
    scale /= max(1., float(fan_in + fan_out) / 2)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
xinmin323 commented 5 years ago
  #  attention = Permute([2, 1])(attention)  # (?,300,?)

try to delete it ,but don't know why

amanjaswani commented 5 years ago

In the attention = Multiply()([decoder_outputs, attention]) line, I'm getting the following error "ValueError: Operands could not be broadcast together with shapes (None, 300) (151,)". I've searched a lot but don't know how to rectify this. Please help me out :'(

pp2805 commented 4 years ago

@amanjaswani Did you resolve that issue, because I'm too getting that error: "ValueError: Operands could not be broadcast together with shapes (None, 128) (300,)".

Ramubala commented 4 years ago

In the attention = Multiply()([decoder_outputs, attention]) line, I'm getting the following error "ValueError: Operands could not be broadcast together with shapes (None, 300) (151,)". I've searched a lot but don't know how to rectify this. Please help me out :'(

you need to modify the function cutoffSequences