C1W4 Assignment Tests are passing but Grader output is failing

Hi,

The tests within the assignment I am getting the below Grader error for Exercise 3: Center data &
Exercise 4: Get covariance matrix.

There was a problem grading your submission. Details:
name ‘imgs’ is not defined

Can someone please help me resolve this and therefore allow me to complete the Linear algebra course ?

Thanks
MarsDenizen

1 Like

Hey there!

It seems like the variable “imgs” is not defined in your code, causing the grading error; you need to define it before using it.

2 Likes

Thank you , the imgs list defined in the earlier segment is not getting recognized by the grader , I used the input parameter’s len() and it passed now.

Thx again for the quick response.

  • MarsDenizen
1 Like

Great! Happy to help :raised_hands:

2 Likes

I am having the same problem, but I do not understand your response. I got “All tests passed” for every exercise, but a grade of 0/20 on each. Could you elaborate on the action “I used the input parameter’s len()”.
Thanks.

@largilla, please post a screen capture image that shows the grader’s detailed feedback.

Note that passing the tests in the notebook does not prove your code is perfect. The grader uses different tests.

There was a problem compiling the code from your notebook. Details:

name ‘imgs_flatten’ is not defined

The above message appeared in the expanded grade for all 5 exercises

Perhaps the grader does not expect you to use that variable.

I finally passed. I was referencing imgs_flatten inside a function without passing it into that function, as far as I can tell. I didn’t get a perfect score, but can I keep working on the programming assignment even though I passed?

Avoid using global variables inside functions.

Yes, you can keep experimenting. Only your highest score counts for your grade.