Course 5 Week 1 Assignment 2, Dino Exercise, Problem with Grader


I am doing the assignment to generate names for dinosaurs. I am having problems with exercise 2 which apparently causes exercise 4 to fail. I don’t have much more information because the Exercise 2 gives me all test passed, however when I call the sample() function in exercise 4 I get this error:

shapes (50,50) and (100,1) not aligned: 50 (dim 1) != 100 (dim 0)

Curiously, this is the same error that the autograder returns for exercise 2 (which gives me all tests passed!) when i submit the assignment.

I tried to guess it is a problem of vector dimensions so just to be sure these are the dimensions I set for X and a are X(27,1) and a (100,1).

Any idea of what could be the problem?

Welcome to the community !

A question is, how did you set the dimension of “a_prev” in sample() ?
“n_a” of a local test for sample() is set to 100. But, model() sets n_a = 50. If a grader sets its value to 50, then, both a local test program and a grader return the same error of
shapes (50,50) and (100,1) not aligned: 50 (dim 1) != 100 (dim 0)

Thanks for the prompt response! Yes it was that, I mistakenly assigned a fixed dimension, and that was the problem (of course it was a problem! :slight_smile: )

Thanks for your help!