# Error in grading my code

**URL:** <https://community.deeplearning.ai/t/error-in-grading-my-code/349502>\
**Category:** Neural Networks and Deep Learning\
**Tags:** coursera-platform\
**Created:** [June 3, 2023, 8:31am UTC](https://community.deeplearning.ai/t/error-in-grading-my-code/349502 "2023-06-03T08:31:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noora\_Arabshahi](https://avatars.discourse-cdn.com/v4/letter/n/e19adc/32.png) [@Noora\_Arabshahi](https://community.deeplearning.ai/u/Noora_Arabshahi)\
**Post date:** [June 3, 2023, 8:31am UTC](https://community.deeplearning.ai/t/error-in-grading-my-code/349502/1 "2023-06-03T08:31:00Z")

</div>

although my code is right i keep getting these errors and get 0 for my assignment  
what are these basic\_sigmoid\_test, sigmoid\_test,…?!

# [ValidateApp | INFO] Validating ‘/home/jovyan/work/submitted/courseraLearner/W2A1/Python\_Basics\_with\_Numpy.ipynb’ [ValidateApp | INFO] Executing notebook with kernel: python3 Tests failed on 8 cell(s)! These tests could be hidden. Please check your submission.

The following cell failed:

```
print("basic_sigmoid(1) = " + str(basic_sigmoid(1)))

basic_sigmoid_test(basic_sigmoid)

```

The error was:

```
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-4-41d37f82dbf3> in <module>
      1 print("basic_sigmoid(1) = " + str(basic_sigmoid(1)))
      2 
----> 3 basic_sigmoid_test(basic_sigmoid)

NameError: name 'basic_sigmoid_test' is not defined

```

==========================================================================================  
The following cell failed:

```
t_x = np.array([1, 2, 3])
print("sigmoid(t_x) = " + str(sigmoid(t_x)))

sigmoid_test(sigmoid)

```

The error was:

```
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-9-51251e2b44ae> in <module>
      2 print("sigmoid(t_x) = " + str(sigmoid(t_x)))
      3 
----> 4 sigmoid_test(sigmoid)

NameError: name 'sigmoid_test' is not defined

```

==========================================================================================  
The following cell failed:

```
t_x = np.array([1, 2, 3])
print ("sigmoid_derivative(t_x) = " + str(sigmoid_derivative(t_x)))

sigmoid_derivative_test(sigmoid_derivative)

```

The error was:

```
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-11-fa7ab0e756fc> in <module>
      2 print ("sigmoid_derivative(t_x) = " + str(sigmoid_derivative(t_x)))
      3 
----> 4 sigmoid_derivative_test(sigmoid_derivative)

NameError: name 'sigmoid_derivative_test' is not defined

```

==========================================================================================  
The following cell failed:

```
# This is a 3 by 3 by 2 array, typically images will be (num_px_x, num_px_y,3) wher...
t_image = np.array([[[0.67826139, 0.29380381],
                     [0.90714982, 0.52835647],
                     [0.4215251 , 0.45017551]],

                   [[0.92814219, 0.96677647],
                    [0.85304703, 0.52351845],
                    [0.19981397, 0.27417313]],

                   [[0.60659855, 0.00533165],
                    [0.10820313, 0.49978937],
                    [0.34144279, 0.94630077]]])

print ("image2vector(image) = " + str(image2vector(t_image)))

image2vector_test(image2vector)

```

The error was:

```
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-13-333007a11e42> in <module>
     14 print ("image2vector(image) = " + str(image2vector(t_image)))
     15 
---> 16 image2vector_test(image2vector)

NameError: name 'image2vector_test' is not defined

```

==========================================================================================  
The following cell failed:

```
x = np.array([[0, 3, 4],
              [1, 6, 4]])
print("normalizeRows(x) = " + str(normalize_rows(x)))

normalizeRows_test(normalize_rows)

```

The error was:

```
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-15-7c7c8401963e> in <module>
      3 print("normalizeRows(x) = " + str(normalize_rows(x)))
      4 
----> 5 normalizeRows_test(normalize_rows)

NameError: name 'normalizeRows_test' is not defined

```

==========================================================================================  
The following cell failed:

```
t_x = np.array([[9, 2, 5, 0, 0],
                [7, 5, 0, 0 ,0]])
print("softmax(x) = " + str(softmax(t_x)))

softmax_test(softmax)

```

The error was:

```
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-17-589a35b2026d> in <module>
      3 print("softmax(x) = " + str(softmax(t_x)))
      4 
----> 5 softmax_test(softmax)

NameError: name 'softmax_test' is not defined

```

==========================================================================================  
The following cell failed:

```
yhat = np.array([.9, 0.2, 0.1, .4, .9])
y = np.array([1, 0, 0, 1, 1])
print("L1 = " + str(L1(yhat, y)))

L1_test(L1)

```

The error was:

```
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-21-3f77e39d7fb5> in <module>
      3 print("L1 = " + str(L1(yhat, y)))
      4 
----> 5 L1_test(L1)

NameError: name 'L1_test' is not defined

```

==========================================================================================  
The following cell failed:

```
yhat = np.array([.9, 0.2, 0.1, .4, .9])
y = np.array([1, 0, 0, 1, 1])

print("L2 = " + str(L2(yhat, y)))

L2_test(L2)

```

The error was:

```
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-23-8bbdf5303d2e> in <module>
      4 print("L2 = " + str(L2(yhat, y)))
      5 
----> 6 L2_test(L2)

NameError: name 'L2_test' is not defined

```

---

<div class="post-metadata">

**Author:** ![Mujassim\_Jamal](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mujassim_jamal/32/53828_2.png) [@Mujassim\_Jamal](https://community.deeplearning.ai/u/Mujassim_Jamal)\
**Post date:** [June 3, 2023, 8:48am UTC](https://community.deeplearning.ai/t/error-in-grading-my-code/349502/2 "2023-06-03T08:48:27Z")

</div>

When you open the notebook, you need to run all the cells from the top. In the first cell, you will find ‘import …’ statements that are defined to load all the necessary dependencies required to run this assignment.

---

<div class="post-metadata">

**Author:** ![Noora\_Arabshahi](https://avatars.discourse-cdn.com/v4/letter/n/e19adc/32.png) [@Noora\_Arabshahi](https://community.deeplearning.ai/u/Noora_Arabshahi)\
**Post date:** [June 3, 2023, 9:05am UTC](https://community.deeplearning.ai/t/error-in-grading-my-code/349502/3 "2023-06-03T09:05:56Z")

</div>

i just have :  
import math  
import numpy as np  
and it is not because of the way of running the cells. because i choose run all the cells

---

<div class="post-metadata">

**Author:** ![Mujassim\_Jamal](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mujassim_jamal/32/53828_2.png) [@Mujassim\_Jamal](https://community.deeplearning.ai/u/Mujassim_Jamal)\
**Post date:** [June 3, 2023, 9:22am UTC](https://community.deeplearning.ai/t/error-in-grading-my-code/349502/4 "2023-06-03T09:22:54Z")

</div>

Please verify that there will be another line '`from public_tests import *` ’ in the `basic_sigmoid` function cell, from where these test functions are loaded.

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [June 3, 2023, 5:07pm UTC](https://community.deeplearning.ai/t/error-in-grading-my-code/349502/5 "2023-06-03T17:07:38Z")

</div>

Every time you open the notebook, you should run all of the cells.

Tip: You should not add any additional import statements to any of the code cells. Sometimes students do this to try and work around problems caused by not running all of the cells first.
