C4W2 - all unit tests work but grade is 0

Dear all,

I am doing the C4W2 assignment. All the graded functions work, at least according to the unit tests. However, when I submit my assignment, I get a grade of 0, with the same error message being displayed for all graded items:

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)

This would seem to refer to the DecoderLayer’s implementation of the second MultiHeadAttention layer, but I couldn’t figure out much more than this.

I see other questions in this forum with exactly the same problem, but none of these students found a solution. I am happy to show my code in private to an instructor if that works better.

Cheers,

Federico

Hi @Federico_Bindi

This looks like exactly your problem. Doesn’t it solve your issue?

Sorry, I had not seen that answer. Yes, it works. Thanks a lot!

I have same problem: unit tests were fine, but grade 0. What 's your solution?