C4 W3 Assignment 2 grading problem

Hi there, I passed all the tests in the assignment but when I submitted it I received a 0 with grader output saying “Cell #3. Can’t compile the student’s code. Error: IndexError(‘list index out of range’)”. I don’t know how to solve this problem. Please help. Thank you!

Most likely, your code includes some sort of fixed index value. Since the grader tests your code with a different size of data set, you should avoid any hard-coded values.

Sounds like you stepped on the landmine that they warned you about in the notebook instructions:

Check out the some of the unmasked and masked images from the dataset:

After you are done exploring, revert back to N=2. Otherwise the autograder will throw a list index out of range error.

Hi @Michael_Liao,

As Tom mentioned, you changed some index value somewhere, likely when you looked through the data.

If you don’t remember where the change was made, I’d recommend get a fresh copy of your notebook by following these instructions, and copy/paste your solutions from the old/current notebook into the freshly fetched one, and then submit it.

Hopefully this error will go away.

Best,
Mubsi

The problem is solved. Thank you all for your help !