I got this exact error and it turned out the solution was this one by Meir.
In “Cell 3” - i.e. the third executable cell, just under " Check out the some of the unmasked and masked images from the dataset", I had changed the index N of the sample image to 10. This worked in the notebook, but broke the grader.