C5_W2_Exercise 4

Hello -
Issue 1 : I seem to have ‘All tests passed’ through Exercise 3 but Grader gives me no credit with 'Code 21 : ‘data type not found’ or something to that effect.

Issue 2 : the link to Embedding() did not point to the right syntax for
Step 3 in Exercise 4 - any tips appreciated.


Issue 1: Please post a screen capture image showing the entire error message from the grader.

Issue 2: I don’t understand your comment about not pointing to the right syntax. Please provide some more evidence. Again, a screen capture image would be helpful.

Hi @TMosh I am having a different problem with the same exercise with the grader.

Grader error:

Exercise 4    0/100
Cell #4. Can't compile the student's code. Error: TypeError("'int' object is not subscriptable",)

Even though, in the assignment, I get all the correct expected outputs.

Seems like your code is using an ‘int’ object somewhere that it shouldn’t.

Hello, not sure I have called int objects explicitly anywhere. In any case, I seem to be missing something in the syntax(?) for th Embedding(), the error:

ValueError: Layer weight shape (15, 2) not compatible with provided weight shape (15, 1, 2)

------------------my code- for mentor use ONLY – pls remove from Post as appropriate!-------------

Can you please post the solution here as well? I am having a similar issue - the tests are passed in the notebook, but the autograder returns “Exercise 4 - Cell #5 Can’t compile the student’s code. Error: TypeError(”‘int’ object is not subscriptable",) "

Hi amir,

You get this error because at some point in your code you are using an integer instead of a variable that is subscriptable (like a word vector or dictionary). Have a look at your code and see if you can find out where you do this.

If you don’t succeed, feel free to send me your code by means of a private message so I can have a look.

Good luck!

This issue appears to have been caused by a cell that was added to the notebook. This may produce errors in grading.

If you want to test cosine similarities, you can do so in Cell # 4 between # START SKIP FOR GRADING and # END SKIP FOR GRADING.