NLP C1_W1_Assignment TypeError

There is a TypeError in the prepopulated cell “Apply gradient descent”; type numpy.ndarray doesn’t define_round_method. I’m not certain what corrections are allowed - without violating the AutoGrader process. According to solutions proposed, rounded needs to be defined. Thanks for your clarification.

1 Like

Hi @Kenneth_Wu

At first glace it looks like you’re trying to round the numpy.ndarray, so maybe the theta your implemented gradientDescent(..) function returns is a multidimensional array?

To check for that, you can get the shape of tmp_theta.



Thanks for your prompt reply. I restarted the notebook from the beginning and no longer have that error. However, I’m still confused on what is permissible to add in coding. I have new errors downstream. The codes were provided in the assignment, so I’m confused why I’m getting error codes when it was provided. Is there some documentation I missed in the course? Thanks for your patience as I become more oriented to the materials. Ken

Generally, when code that you didn’t write throws an error, it’s because that code is calling one of the functions you modified (usually via a test case), and the function you modified doesn’t work correctly.

It’s helpful to post a screen capture image of the error message.

Perhaps the NLP mentor will be able to decipher the issue if you have the error message here for them to view.

Thanks for your quick reply. I agree that posting the error message would be more informative. Will you confirm this doesn’t violate the class rules? I read a posts, that we weren’t to share our code. As i mentioned, the code was already provided, so… I don’t see anything wrong with sharing the error message. thanks

Please read my previous reply again.