C1_W3_Assign.(Error: matmul: Input operand 1..) Zero grade on submitting

Hi Everyone,

I hope all is well.

The following error (in quotes “”):
“There was a problem compiling the code from your notebook. Details:
matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 2 is different from 1)”

I know its mentioned in Week 3 lab “Matrix Multiplication”, for some reason in C1_W3-Assignment I am getting this same error in all my exercises (all 6) and when I try to submit I end up with zero grade. I Tried to find the exact source of the problem but couldn’t pinpoint it, anyone had a similar issue? I tried the usual, reloading, going back to “Matrix Multiplication” lab to find a solution that works…etc but nothing is working until now.

Thank you,

When you look at the forward_propagation() function in your notebook, does it appear like this (with three arguments)?
image

Hi,

Thanks for replying so quickly!! Yes, it does have three arguments.

Saleh

Please check your private messages for instructions.

I am getting a similar error in exercise 5:

upon executing the cell containing function: w3_unittest.test_nn_model(nn_model)

ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 2 is different from 1)

Could you help solving the problem with this?

For those who find this thread later:
The forward_propagation() function should use the np.dot() function to compute the product of W and X.

Are you using np.dot()?

I was using vector multiplication! When I use np.dot(W,X)+b I get following error:
ValueError: shapes (1,1) and (2,5) not aligned: 1 (dim 1) != 2 (dim 0)

Please note I also receive an error when using the unit test:
w3_unittest.test_layer_sizes(layer_sizes) in Exercise 2:

Wrong size of the input layer n_x for the test case, where array X has a shape (5, 100).
Expected: 5.
Got: 1.
Wrong size of the output layer n_y for the test case, where array Y has a shape (3, 100).
Expected: 3.
Got: 1.

I wonder if there is an issue with the unit test or the notebook version I am using?

Thank you for prompt response

There is probably an error in your layer_sizes() function. Fix that before you go any farther.