Unet autograder throwing error despite passing all the tests

Code Cell UNQ_C3: Function ‘unet_model’ is incorrect. Check implementation.

Hey, I’m getting the following error message (mentioned above) for the implementation of the unet_model function despite of passing the test inside the notebook. I would really appreciate if someone could tell me if i have made some mistake while implementing the function or if everyone is getting the same error message.


Hello Jaylodha,

Thank you for your question.
Can you post a screenshot of the cell producing the error? (I will ask you to remove it once we solve your problem)



PFA the grader’s output’s screenshot as well.

Hi @jaylodha
Have you fixed the issue?
Could you please print the model summary?

Notice that you are hard-coding a number of the parameters at various levels. E.g. in the contracting path you just set n_filters to 64 then 128 and so forth. What if the actual input value of n_filters is not the default value of 32? It’s safer to write, e.g., n_filters * 2 instead of 64. Then in the final Conv2d layer, you hard-code 23 instead of using n_classes. What if the grader uses a different value of n_classes?

I tried making just the “23” mistake and I get the same grader output that you get.

Update: I fixed the “23” bug and then did the n_filters hard-code on just two layers of the downsampling path and I get the same 66/100 score. So the grader notices both of those independently and considers them mistakes.

1 Like

@paulinpaloalto Thanks a lot for pointing it out. I’ll make the aforementioned changes right away.

Also I’ll take down the assignment screenshots and post the autograder summary again after making the required tweaks @carlosrl

@carlosrl The issue has been fixed.

@paulinpaloalto Thankyou so much for highlighting the errors.


That’s great news! Thanks for confirming and thanks for removing the source code.