Week 1 assignment grader bug

Hi @Community-Team ,
I’m observing this grader error despite multiple attempts. The code works on the lab notebook.

Could you please look into this?

[ValidateApp | INFO] Validating '/home/jovyan/work/submitted/courseraLearner/W1_Assignment/C1W1_Assignment.ipynb'
[ValidateApp | INFO] Executing notebook with kernel: python3
2021-11-06 19:11:41.786400: 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
2021-11-06 19:11:41.786484: 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
2021-11-06 19:11:41.786495: 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.
2021-11-06 19:11:43.262454: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2021-11-06 19:11:43.262489: E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ERROR (303)
2021-11-06 19:11:43.262517: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (ip-10-2-96-90.ec2.internal): /proc/driver/nvidia/version does not exist
2021-11-06 19:11:43.262679: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2021-11-06 19:11:43.288051: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2999995000 Hz
2021-11-06 19:11:43.290200: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x56491c906030 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-11-06 19:11:43.290231: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
[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:


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


The error says you have not defined the variable history, you must not be saving the model fitting in the history.

Please see the screenshot. It shows that the test passes on the jupyter notebook on coursera platform. The bug is in the grader.

Check how you defined history, the parameters inside the model.fit especially, there should be something wrong there.

If my definition of history is wrong, how can the tests on the coursera notebook environment pass? I’ve not modified anything other than the notebook. If you read the issue description, you’ll see the an image with text All public tests passed.

Well the error says history is not defined, i advise you to check history and its dependencies. If the error is still persisting then send me a copy of your assignment in my inbox ill have a loot at.

Across all of the deeplearning courses the most common source of issues like this is submitting back-level notebooks to the grader. If you haven’t done an explicit save/checkpoint and kernel restart on the notebook before submitting for grade, you should try it before doing more causal analysis.

I saved the notebook before submitting.

1 Like

The next easy thing to check for is use of a ‘global’ variable in the notebook. The grader executes the graded functions from your notebook, but not any code from other notebook cells. It is sometimes possible to get the notebook to run ‘correctly’ using a variable with notebook scope, but that same code will fail the grader since it isn’t aware of the context larger than the function being graded. Hope it helps.

Thank you, @ai_curious but I changed things only at places marked with # your code here. This is a grader bug for sure. Hence the reason for tagging this issue with @Community-Team .

I’ve been working with these courses for almost 4 years, and have seen people make that assertion countless times. It only very rarely is, as usually it’s something small (like the above suggestions) that resolves it. Yours may be one of those rare cases, in which case only the DL staff can help.

I should point out that using a global variable inside a function doesn’t imply changing code outside the hash tags. It could be as subtle as referencing a notebook scope variable from a previously executed cell instead of the local variable passed as a parameter to the function.


Guess we’ll know once the @Community-Team confirm. That said, history is a global variable. Not sure if the grader uses a different version of the utils script to test.

If it was a grader problem many people would have it, thats why i pressed its something wrong in the solutions even though it passes the tests sometimes something is not quite right. I think i have seen this kind of error before here and it was something wrong in the solution…

1 Like

Could you please check my notebook on the coursera environment or do you want me to paste the code here?

I dont have access to you coursera and no dont paste it here, send it to me in private message.

@gent.spah Sent you a message.


And the fact that history is a global suggests to me strongly there is context leakage in the notebook that isn’t happening in the grader. I love a good code puzzle, so please share what you learn after your examination.

Well, the code written is supposed to be right! There must be something wrong with the utils file or maybe something is updated and is not read properly, it doesn’t recognize the history it seems, probably something to do with history being global as @ai_curious says, maybe because history is also named the parameter of the function test_history in utils. I would suggest to do a force refresh of your notebook and submit again. You can find how to do force refresh in Coursera if you search. Other than this I can not see where the problem might be and if stays still on we might have to report this as an issue.

1 Like

@gent.spah Thanks for confirming.

Please file a ticket and provide the link to it in this page.

1 Like

Have raised the issue , lets see what turns out of it.