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)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lstm_attention.py

sanjayb678 opened this issue · comments

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.

Hello, How we can fix this error ?

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'
  #  attention = Permute([2, 1])(attention)  # (?,300,?)

try to delete it ,but don't know why

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 :'(

@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,)".

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