C4W2 cannot graded

I have problem with submittion although i follow the hint
There was a problem compiling the code from your notebook. Details:
Exception encountered when calling layer ‘softmax_3’ (type Softmax).

{{function_node _wrapped__AddV2_device/job:localhost/replica:0/task:0/device:CPU:0}} Incompatible shapes: [1,2,2,150] vs. [1,1,1,2] [Op:AddV2] name:

Call arguments received by layer ‘softmax_3’ (type Softmax):
• inputs=tf.Tensor(shape=(1, 2, 2, 150), dtype=float32)
• mask=tf.Tensor(shape=(1, 1, 1, 2), dtype=float32)

1 Like

Do you know the posting rules, you are not supposed to publish code solutions!

At attention_weights try without the axis parameter!


Thank you and sorry. I read a lot of posts having the same problem, but nobody did not know what is error without code

1 Like

Yes next time ask them to send it in private!

But i still not works :frowning:

1 Like

I have fixed like you suggest but it still not works

1 Like

Send me the entire notebook in private let me have a look in it…

Had anybody done this assignment :frowning: I didn’t know how to fix

1 Like

Try maybe reseting the notebook and redo the entire assignment, sometimes the problems are found going through it again. But keep your current solutions so you can reuse them!

1 Like

For future learners - the OP’s mistake was in defining the dec_padding_mask.

Note, that when creating padding mask for the decoder’s second attention block - we use the encoder_input. In other words, we inform the decoder to not pay attention to padding tokens of the document to be summarized.

Also note, that this is different from look_ahead_mask (causal mask) where decoder is only allowed to pay attention to itself and its previous tokens.



Thank you so much I was getting the same error solved

1 Like