MSL Course 1 Week 2 Exercise 1 Error

I am finding this error repeatedly coming up even though I have not changed any of the pre written code. Please could someone help me with this issue!

Thanks in advance :slight_smile:

Hi @Shalini_Hirani, compute_cost is the exercise you should have done, and that error comes up because you have not run the cell that contains the exercise. Please make sure to run all the code cells from top to bottom every time you open the notebook.

Hi, Thank you for your advice.
I am still getting the error despite this :frowning:

You saying that you have run the cell that defines compute_cost but it still get the error that compute_cost is not defined? Would you please check if there is any spelling mistake in the def line for compute_cost?

Thank you for your help! It seems there was an issue with the position of one of the lines of code hence the cell with compute_cost kept giving me an error.

Good to know that you have solved the problem!

1 Like