Course 1, Week 4, Assignment #2

I’m getting this error with the grader:

[ValidateApp | INFO] Validating '/home/jovyan/work/submitted/courseraLearner/W4A2/Deep Neural Network - Application.ipynb'
[ValidateApp | INFO] Executing notebook with kernel: python3
[ValidateApp | ERROR] Timeout waiting for execute reply (30s).
[ValidateApp | ERROR] Interrupting kernel
Tests failed on 1 cell(s)! These tests could be hidden. Please check your submission.
==========================================================================================
The following cell failed:

    parameters, costs = L_layer_model(train_x, train_y, layers_dims, num_iterations = 1...
    
    print("Cost after first iteration: " + str(costs[0]))
    
    L_layer_model_test(L_layer_model)

The error was:

    ---------------------------------------------------------------------------
    NameError                                 Traceback (most recent call last)
    <ipython-input-14-d5e7eb27c0fc> in <module>
    ----> 1 parameters, costs = L_layer_model(train_x, train_y, layers_dims, num_iterat...
          2 
          3 print("Cost after first iteration: " + str(costs[0]))
          4 
          5 L_layer_model_test(L_layer_model)
    
    <ipython-input-13-1c36a5f1a90c> in L_layer_model(X, Y, layers_dims, learning_rate, ...
         24     # parameters = ...
         25     # YOUR CODE STARTS HERE
    ---> 26     parameters = initialize_parameters_deep(layers_dim)
         27 
         28     # YOUR CODE ENDS HERE
    
    NameError: name 'layers_dim' is not defined

I’m realizing I’m getting a 50/100 for the grade because it can’t get past this cell, but layers_dim is properly defined two cells above. So I’m not sure why it can’t find that variable. I tried rebooting, restarting the kernel, updating the lab, but I’m still having trouble here. Any ideas on how to help?

Hey @jmathew for next time can you please make sure you are posting in the right category ? Because if you don’t, you might be left unanswered, as the mentors won’t be aware of your post. For this, I have moved your post to the C1 category.

now…can you DM me your notebook so I could take a look ? Thanks.

Sorry, I’m new to Discourse. I’ll DM you my notebook

1 Like

Hi @jmathew, the variable you want to use it is not called layers_dim, it is called layers_dims. That’s why you are getting the ‘no defined’ error.

Thanks @albertovilla , once I was able to restart the kernel properly I was able to see the error in my notebook.