#19. Can’t compile the student’s code. Error: ValueError(‘shapes (0,3) and (2,) not aligned: 3 (dim 1) != 2 (dim 0)’)
please help me here.
#19. Can’t compile the student’s code. Error: ValueError(‘shapes (0,3) and (2,) not aligned: 3 (dim 1) != 2 (dim 0)’)
please help me here.
@om_singh can you please tell in which Exercise and cell this error occured?
It is in the ML2,
week 1, last lab
Can you please share a screenshot of the error you are facing? remember don’t include any of your code. only the errors.
Hi @om_singh,
After looking at the lab I suspect you are either getting as an error in the Exercise 2 or Exercise 3.
In the case of Exercise 2:
In the case of Exercise 3:
I suspect you are getting an error because you are using np.matmul
in the wrong way. remember that np.matmul
requires the two matrices to have match no. of columns and no. of rows as the number of columns of the first matrix equals the number of rows of the second matrix.
for example: if you have two matrices A and B where
A → (m, n) then matrix B must be (n, k) . Now you can use np.matmul
as np.matmul(A, B)
which results in other matrix C → (m, k).
Hi @om_singh ,
One other thing to check is accessing the w for each unit(neuron) for the computation is done correctly. In the case of ex2, where each w vector for a unit is accessed by the indexing of, for example, j, then, w is W[:,j]
yes, this was the mistake, i found it .
Thank you very much
thank you so much for explaining
its done now, thank you
@om_singh
Glad to hear that.