C2_W1_Assignment Grader time out while grading dLdOmega_of_omega_array

I have been redirected here by the Coursera support team for this issue.

The error returned by the grader is a time out, resulting in a 0 for the dLdOmega_array score.

I have run the solution on my local machine and the result is as expected and completes in ~2 minutes.

Complete cell:
{mentor edit: image removed}

looking for input on if this can be resolved as a 0 on this function results in a failing score for the lab.

Adding the grader error here as only one screenshot allowed in the above.

Grader error:

Additionally, I have already tried rebooting the notebook and attempting a resubmission, same result.

What platform are you using to run the notebook?

I ask because I don’t see anything in the notebook that would display the cell runtime that you have shown.

Did you add something that does this?

There is a similar thread related to your issue, make sure your code are written as per the instructions give in the excercise

please refer this thread

Also kindly remove the image where you sharing grade function codes which grades your assignment, that is a violation of Code of Conduct and against community guidelines. if a mentor wants to see your codes, they would ask you to send them by personal DM

Regards
DP

Can you be more specific on what you mean by “platform”?

Platform: The computing environment that you are using.

The platform that the course uses is Jupyter Notebooks as provided on Coursera’s servers.

Is that where you are doing the assignment?

Yes, of course the assignment runs in the notebook server for the lab. That is all handled by the Coursera platform.

To test the lab notebook I downloaded and ran the same notebook on my local machine.
Python version: 3.13
Jupyter core: 5.7.2
Ipython: 8.28
Host OS: macos 15.5

Is your local machine where the code execution time information came from?

No, the time out occurs when the Coursera grader runs the lab notebook. Locally, with the above environment, the cell executes as expected in ~2 minutes and the tests pass.

Interesting. It is possible to add code to measure the compute time on the Coursera servers as well. To avoid messing with the graded cells, I added the following cell to my notebook and here’s what I see:

You can see that it takes just over 12 seconds of compute time to run my version of that code. I tried it several times and the times are pretty consistent. It might be worth trying that in your notebook on Coursera and see what you get. The code you showed (now edited out) looked the same as mine for dLdOmega_of_omega_array, but notice that you are also invoking your earlier code as a subroutine there. Maybe your logic for L_of_omega is inefficient somehow.

So, I have not changed L_of_omega. @Deepti_Prasad mention of f_of_omega implementation is the solution, at least to the issue I had. Thanks for the input on this everyone.

3 Likes

But L_of_omega directly calls f_of_omega, right?

Just to make sure I’m understanding the state of play: it sounds like you’re saying that you’ve found the solution here. If so, that’s great news.

i think the grader feedback for time out error lies in the same screenshot solution I shared with you, where it shows prices are converted into numpy arrays and if the implementation are incorrect, it probably led to subsequent error as per grader file I just checked where exercise 4 is an organised function to check if all the previous grade functions are correctly written as per calculations.

The instructions clearly mentions.

Happy to help!

Regards
DP

1 Like