Why it showing like this even though i did define

ValidateApp | INFO] Validating ‘/home/jovyan/work/submitted/courseraLearner/W1_Assignment/C1W1_Assignment.ipynb’
[ValidateApp | INFO] Executing notebook with kernel: python3
2024-05-15 04:41:21.519823: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libnvinfer.so.6’; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory
2024-05-15 04:41:21.519900: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libnvinfer_plugin.so.6’; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory
2024-05-15 04:41:21.519911: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Tests failed on 10 cell(s)! These tests could be hidden. Please check your submission.

The following cell failed:

# You can click `File -> Open` in the menu above and open the `utils.py` file 
# in case you want to inspect the unit tests being used for each graded function.

utils.test_white_df(white_df)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-3-8e54b75f4c04> in <module>
      2 # in case you want to inspect the unit tests being used for each graded fun...
      3 
----> 4 utils.test_white_df(white_df)

NameError: name 'white_df' is not defined

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

utils.test_red_df(red_df)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-6-8b24a524685c> in <module>
----> 1 utils.test_red_df(red_df)

NameError: name 'red_df' is not defined

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

utils.test_df_drop(df)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-13-02ac41180da9> in <module>
----> 1 utils.test_df_drop(df)
      2 

NameError: name 'df' is not defined

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

utils.test_data_sizes(train.size, test.size, val.size)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-17-a858ae1ed80e> in <module>
----> 1 utils.test_data_sizes(train.size, test.size, val.size)
      2 

NameError: name 'train' is not defined

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

utils.test_format_output(df, train_Y, val_Y, test_Y)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-22-8710fc094fd1> in <module>
----> 1 utils.test_format_output(df, train_Y, val_Y, test_Y)

NameError: name 'df' is not defined

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

utils.test_norm(norm_train_X, norm_val_X, norm_test_X, train, val, test)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-26-67372534a214> in <module>
----> 1 utils.test_norm(norm_train_X, norm_val_X, norm_test_X, train, val, test)

NameError: name 'norm_train_X' is not defined

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

utils.test_base_model(base_model)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-28-468cefd178cd> in <module>
----> 1 utils.test_base_model(base_model)

~/work/submitted/courseraLearner/W1_Assignment/utils.py in test_base_model(base_mod...
    215 
    216     test_inputs = tf.keras.layers.Input(shape=(11,))
--> 217     test_output = base_model(test_inputs)
    218     test_model = Model(inputs=test_inputs, outputs=test_output)
    219 

<ipython-input-27-810c5a1afbf2> in base_model(inputs)
      7 
      8     # connect a Dense layer with 128 neurons and a relu activation
----> 9     x = Dense(128, activation = 'relu', input_shape = (norm_train_X.shape[1...
     10 
     11     # connect another Dense layer with 128 neurons and a relu activation

NameError: name 'norm_train_X' is not defined

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

utils.test_final_model(final_model)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-30-627ff8303ae7> in <module>
----> 1 utils.test_final_model(final_model)

~/work/submitted/courseraLearner/W1_Assignment/utils.py in test_final_model(final_m...
    262 
    263     test_inputs = tf.keras.layers.Input(shape=(11,))
--> 264     test_output = final_model(test_inputs)
    265 
    266     test_cases = [

<ipython-input-29-2e9d2a030966> in final_model(inputs)
      8 
      9     # get the base model
---> 10     x = base_model(inputs)
     11 
     12     # connect the output Dense layer for regression

<ipython-input-27-810c5a1afbf2> in base_model(inputs)
      7 
      8     # connect a Dense layer with 128 neurons and a relu activation
----> 9     x = Dense(128, activation = 'relu', input_shape = (norm_train_X.shape[1...
     10 
     11     # connect another Dense layer with 128 neurons and a relu activation

NameError: name 'norm_train_X' is not defined

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

utils.test_model_compile(model)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-32-9a25711e305e> in <module>
----> 1 utils.test_model_compile(model)

NameError: name 'model' is not defined

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

utils.test_history(history)

The error was:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-34-bb2fa200c0ad> in <module>
----> 1 utils.test_history(history)

NameError: name 'history' is not defined

i did define everything

1 Like

Hi @javvadi111

Make sure that the variable are defined and accessible from their scope and you use the same names without typos. Also, ensure that you import required libraries and you run the cells in correct order!

If the issue persists, try restarting the kernel and re-running you code.

Hope this helps!

1 Like

I did but no use

1 Like

i did but no use

please look into it

1 Like

The problem indicates that you have neither defined those variables nor run the cells corresponding to them! Also, check the variable scopes.

Try finding the solution yourself! But feel free to send me your code via private message, and we can work through it together.

1 Like

okay i will try by myself if i didnt get then i will send you code

2 Likes

@javvadi111

Your issue is related to the link you have to for white and red.df. please use search engine you will find many threads where the link is provided. If you don’t get, let me know

please look into it

1 Like

I just ran your code locally and all of the test cells printed : All public tests passed!

1 Like

Don’t share assignment notebook or codes on public post thread. It is against community guidelines.

1 Like

Sorry I am being busy in my own work for few days. I hope your issue is resolved? Let me know if you want me to check the codes.

I am more sure about issue being as using incorrect link used for df. If you didn’t find let me know.

@javvadi111, you need to run all cells in order. The earlier cells will define values used by later cells.

1 Like

Why are asking utils py file. You are doing a graded assignment in a course?

I did when I validate it shows all cases arebpassed when I submit then in grades it showse all these errors

1 Like

Kindly share a screenshot where you it shows all test cell passed and a screenshot showing why your grading failed by clicking on show grader output which would give insight on why you failed your submission.

That is extremely unlikely, unless you wrote your own utils.py file, or if you modified the one that was provided.



Have you edited the utils.py file?
Are you using the current version of both the utils.py and the lab notebook?

I recommend you rename your utils.py file, then use the “Get latest version” tool to get a fresh copy.