C3_W1_E6 Debugging matrices size - mul got incompatible shapes for broadcasting: (16,), (14,)

I need help
I got this error “TypeError: mul got incompatible shapes for broadcasting: (16,), (14,).”

I have been checking all the usual suspects (axis=1, and evaltasks=eval_task, and all my tests for the previous questions are passing)
Yet I cannot debug this error message
the 14 can only be linked to the max length of a tweet. and the 16 to the batch size
it must be somewhere between my generator and my Embedding layer
But I cannot print out the dimensions of the intermediate variables as this is now a big sequencer
=+> could this be the answer on how to debug the size of each expected input, weights and outputs matrix
Thank you

2 Likes

OK I found the problem that was Exercise 2 - data_generator - which was the size of the generated example_weights array - which I made equal to the max tweet length and not the batch size
This did not get detected neither by the " Expected output"
nor by the w1_unittest.test_data_generator
Another bug that remained undected is the size of the target if we are tempted to write it as pos_index+neg_index instead of 2*n_to_take this does not get detected (even if we are doing another run or if index_pos passes len_data_pos

5 Likes