Hello,
I got all the exercises completed but on the autograder I’m getting the following error:
In Code Cell UNQ_C2, we expected code range (len(label)) and could not find it.
Code Cell UNQ_C1: Function ‘grad_cam’ is correct.
Code Cell UNQ_C2: Function ‘compute_gradcam’ is correct.
Code Cell UNQ_C3: Function ‘permute_feature’ is correct.
Code Cell UNQ_C4: Function ‘permutation_importance’ is correct.
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.
I’m not sure what is wrong here, any help will be appreciated.
Hi @Eder_Gomez,
Can you please send me your code of UNQ_C2 privately, and I will check the error for you?
I took this class a couple of years ago, and the grader may have changed since then, but IIRC this grader is a little different than most of the other deeplearning courses in that it uses white lists. Almost all other graders look only at function output; returned dtype must match and value(s) must at least pass isclose() numpy.isclose — NumPy v1.26 Manual
In this course the grader additionally parses the code and looks for implementation details. If it expects keras.mean() it will fail if you wrote a loop and calculated yourself even if the numeric answer is correct. Note that this means you can match the notebook Expected Output and pass the notebook unit tests, but still fail the grader, which seems like what happened here and is a not uncommon reason for posts in the forum. The clue is that you have both of these in the grader feedback:
In Code Cell UNQ_C2, we expected code range (len(label)) and could not find it.
Code Cell UNQ_C2: Function ‘compute_gradcam’ is correct.
When this happens, inspect your implementation for code that achieves the same outcome but isn’t expressed exactly how the grader wants it. Python always allows more than one way to express your intent, but the grader, not so much. HTH