Unable to submit Week 2 Emojify assignment

Hi,
I am trying to submit my emojify assignment but I keep on getting a score of zero.
When I run the code in my browser, I don’t get any errors and it shows all tests passed. Still I am getting a score of zero.
I get this in grader output -

Cell #14. Can’t compile the student’s code. Error: ValueError('operands could not be broadcast together with shapes (5,2) (5,) ',)

Please help me out with this.

Also, the course content is awesome, thanks for it .

Make sure the sentence_to_avg function is working. I got the same problem.

Hi,
Thanks for your reply.
It is working well.
I don’t see any problem there.
It shows all tests passed too.

Might be some other issue, but I am not able to figure out.

Have the same problem!
Grader says: “Cell #22. Can't compile the student's code. Error: KeyError('funny',)”.
Did you resolve problem?

The problem turned out to be that I shortened some lines. I rewrote it in good order and it all passed. Try updating the task to the original one (get latest version) and carefully fill in the missing lines.

I have the exact same problem. How to resolve it?

I found the bug in my code, instead of hardcoding avg in avg_to_sentence function you should pass any_word (which is already calculated) to word_to_vec_map followed by .shape method to word_to_vec_map and wrap the whole in np.zeros

2 Likes

for sentence_to_avg function try to use
avg = np.zeros(word_to_vec_map[any_word[0]].shape)