Issue with Auto-Grader in 'Sequence Models' Assignment

Hello ,

I’m currently enrolled in your “Sequence Models” course and have been facing a specific issue with the assignment. While everything seems to work fine in my local notebook and all tests complete successfully, I run into an error when I try to submit my assignment to Coursera’s auto-grader.

The problem appears to be associated with the vector size used to test one of the preloaded functions in the lab. Interestingly, this occurs even before any of my own code segments are executed, specifically in cell 13.

Given this situation, I’m reaching out for assistance. If a direct solution isn’t feasible, I would highly appreciate any additional information or details you might offer regarding this matter. It’s my suspicion that the issue could be tied to the unit tests utilized by the platform’s auto-grader.

Thank you for your time, and I’m looking forward to resolving this problem soon.

Hi @JUAN_PABLO_RESTREPO1,

  1. Please start by sharing a screenshot of the error you are getting from the autograder. How can the community know the error you are getting?
  2. Just saying and explaining, Issue with Auto-Grader in 'Sequence Models' Assignment isn’t helpful, is it ? You didn’t mention the week number and the assignment name.
  3. Are you trying to run the notebook locally on your system and then upload on coursera to submit ?

Thanks,
Mubsi

Yes, as Mubsi says, it would be helpful to know which assignment and to see the actual output of the grader.

Just as a general matter, note that the test cases in all the notebooks are not complete SQA test suites: just passing those particular tests does not guarantee that your code is fully correct in all possible test cases. SQA is actually pretty hard and it’s a whole field of study unto itself.

For example, there are lots of ways in which it’s possible to solve the problems in a “non-general” way: e.g. hard-coding some of the assumptions about dimensions such that they happen to match the test case in the notebook. Or referencing global variables in the local notebook from the context of your solution code, but then the grader passes a different variable.

So the first thing to consider is to look at the actual error message and map that back to the particular function and ask yourself the “non-generality” questions that I just described.

1 Like

Hello Mubsi, paulinpaloalto,

Thank you for your responses. I’m working on the programming assignment for week 2 called “Emojify”. I’ve reviewed the notebook again and can confirm that the error arises before reaching any editable or gradable portion of my code. Specifically, in cell 13, I receive the following error from the auto-grader: ValueError('operands could not be broadcast together with shapes (5,2) (5,) ',).

I’m working directly from Coursera’s online platform and have only made modifications in the gradable cells. Given that this error seems to be related to an operation between matrices and/or vectors with incompatible dimensions, I was wondering if there is any initial setting or parameter that I should adjust or if there might be an issue with the notebook or the auto-grader itself.

I appreciate in advance any further guidance or recommendations you can provide.

Remember that the cell numbers only apply to the code cells, right? So by my count cell #13 would be UNQ_C2 or the test cell for that function. So I believe that means it is not failing before it gets to any cells containing your code.

I was able to run this notebook and get it graded without seeing this problem.

Hi @JUAN_PABLO_RESTREPO1,

The notebook and the auto-grader have no issue.

Since you mentioned your notebook runs fine, but is failing the autograder,

  • My first guess would be, something in your notebook might have changed which shouldn’t have had. Try getting the latest version of the assignment by following the instructions provided under the heading Refreshing your Workspace.
  • If that doesn’t help, and given the nature of the error, it is possible you might be hard-coding something (autograder’s cell #13 is not the same as cell #13 in your notebook), so you’d need to look for that.

If these don’t work, let me know.

Best,
Mubsi

Hello @Mubsi , @paulinpaloalto ,

Thank you for your valuable insights and suggestions. I am in the process of trying out the proposed solutions - refreshing my workspace to get the latest version of the assignment and revisiting my code to ensure there are no hard-coded values, as you suggested, respectively.

I will reattempt submitting the assignment to Coursera’s auto-grader post these amendments and will keep you both updated on whether these steps were able to resolve the issue.

I appreciate the assistance provided.

If our suggestions above are not enough to get you to a solution, there are other ways we can potentially help. Please keep us posted and I’ll send you a DM about other ways to proceed.

1 Like

Hello @Mubsi, @paulinpaloalto,

Thanks to your insights, I’ve resolved the issue. I appreciate the prompt and clear guidance.