In the above course module 1 the coding assignment my code passed all the tests. Among the 4 exercises I get “Unknown Error” and awarded 0/10 in the FIRST part. I got 10/10 in the remaining 3 cases. So I get 75% and therefore failed. I would like some assistance regarding this. Thank you.
In general, you might have better luck getting a timely response if you filed this under the category of the PyTorch specialization. You can modify that by using the little “edit pencil” on the title.
If you pass the tests in the notebook, but fail the grader, then it means your code is not general. E.g. you are referencing global variables from your functions or hard-coding some assumptions in the code that happen to match the data in the test case(s) in the notebook. Please have another careful look at your solution code for the first function with that idea in mind and see if that gives you any insights.
If not, then let us know. We may need to look at your code to get further, but we can’t do that in a public thread. If we need to “go there”, I will contact you about how to do that.
Thank you. I fixed it by including an if statement within the loop where it belongs instead of outside. I don’t know how it didn’t the rest of the code.
It’s good news that you were able to find the bug by re-examining the code. Onward! ![]()