[Week 2 ] Assignment 1: Operations on Word Vectors - Debiasing

Hi. I have a problem with my assignment. In notebook everything works correctly and I pass all the test but when I want to submit my assignment a always get 0 point because I have an error “Cell #3. Can’t compile the student’s code. Error: TypeError(”‘int’ object is not subscriptable",)". However in my notebook there is no any error.

Same problem. Spending hours to check every line of my code without finding the errors.
My error is a little different:

Cell #4. Can’t compile the student’s code. Error: TypeError(“‘int’ object is not subscriptable”,)

Edit 1: I have removed the code cell by cell, and the error one is at function complete_analogy. Though, I cannot pin point the exact problem

Edit 2: Found it.
I have modified the cell which contains

“father = word_to_vec_map[“father”]”

by adding some lines like

king = word_to_vec_map[“king”]

after the line # END SKIP FOR GRADING, for additional testing, like suggested. After that, the “int” object is not subscriptable error appears.

I have tried to remove the additional test code, the error disappears. Insert the test code again, the error reappears.

Pretty sure this is the problem, but I still don’t know why. @Patryk can you confirm my finding ?

Hi All,

Unfortunately, I am facing the same problem too…i checked all the graded cells and made sure, i havent updated any content there, but still not able to get rid of this error in the grading.

Cell #3. Can’t compile the student’s code. Error: TypeError("‘int’ object is not iterable",)

I was finally able to get rid of this error…there was an extra cell which i created for myself and didnt think it would impact the grading. But finally I was able to figure it out and get rid of it after a few frustrating hours.


Thanks, I also had the same compile problem, and the solution was the same as Sukhdeep2006 to remove an extra cell that I made to run additional examples. The assignment mentioned to:
" Hint : Try to find some other analogy pairs that will work, along with some others where the algorithm doesn’t give the right answer:"
and adding a new cell underneath this cell seemed to break compilation.

+1. The “Try different words!” prompt should follow up by saying, “If you created extra cells to test out your implementation, please delete them before submitting the assignment as the built-in order of the cells is crucial for automated grading of the assignment.”

Or, the hard-coded dependency on cell # in the autograder should be removed :slight_smile:

Yes, NKelkar.

You are very right. Please be cautious while submitting the solution to the grader. A few instructions have already been mentioned at the start of the notebook. You need to follow them before submission.

Note: We are sorry for this late response.