Error on last cell C1_W3_Assignment

I keep getting zeros on the homework when I submit. I have refreshed it and I’ve started over. I’m now getting this error on the last cell which I don’t believe is apart of the assignment.

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)

Everything else seems to have run fine but I’m not sure.

Can you say a little about where you got your copy of the notebook from? Was it placed in your Files area when you started the assignment, or did you get it from somewhere else?

It was placed in the my files area. The original assignment is there as well.

Sorry, what do you mean by “the original assignment”?

You should have only one copy of the assignment notebook file. You can’t make duplicates or rename the notebook if you want to have it graded.

It would be helpful if you post a screen capture image that shows the contents of your File → Open menu.

When I followed the directions on refreshing your workspace. The second one popped.

I saw a similar topic where someone suggested deleting the notebook and starting fresh. I’m going to try that and report back if I have any problems.

Please post another image that shows the right side of the File menu, where the age of the files is displayed.

This course is currently being updated, so you might have gotten both versions of the lab.

I don’t have any instructions from DLAI about the transition to the new course.

Sorry I jumped the gun and started on a fresh notebook. Really trying to get this submitted and graded. This is the input that is noted for each exercise.

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)

And yes my forward propagation looks like this
def forward_propagation(X, parameters, n_y):

I’m going to have to do some research on the upgrade in the course, and which notebook file you should be using, and maybe chat with the DLAI staff tomorrow.

This will take a few hours.

Okay no problem. Thanks for your help


Did you add the “V2” text to the file name, or was it delivered to you like that?

And I would really like to see the “last modified” date on your Files content.


I was able to submit my notebook file that I have not modified since November 2023. Its file name is C1_W3_Assignment.ipynb.

From searching the forum for “gufunc” errors:

  • Does your forward_propagation() function use It should.
  • If you are using, then check for errors in your “layer_sizes()” function.

I added V2 to. I was following the directions, it said to rename it to something similar.

I deleted the old notebook but the first notebook I was working out of said 3 months ago

My forward_propagation() does use
And I’m not getting any errors in my layer_sizes() function. Should I try running this cell w3_unittest.test_layer_sizes(layer_sizes)

When I first did the assignment I kept getting Assertion errors in the W3_unittest cells. Not for all of them but I think for the last 2 or 3 exercises.

Note that you can’t submit a renamed notebook for grading. The one you renamed should only be used for reference, but never add any more code to it, and do not try to submit it for grading.

When you get an assert, please post a screen capture image of it.

Check your layer_sizes() function carefully. Passing the tests in the notebook does not prove your code is perfect.

You should run all of the cells in the notebook. Then inspect that all your results pass and all of your expected outputs are corred.

“3 months ago” is when the file was created and saved in the course repo. It’s not the date that you obtained it.

The date is only updated after a save, an autosave, or a Save and Checkpoint.

I only have 1 copy of the assignment now. The other notebooks have been deleted. As far as the layer_sizes I’ll keep looking but if I’m not getting an error I’m not sure where my mistake is. Here is the error in the initialize_parameters section when I run this cell


Actual values are not checked here in the unit tests (due to random initialization).