W4_A1_Can't validate my assignment

Hello,
Hopefully this is the right place for my question.

I’m working on the issues of Building_your_Deep_Neural_Network_Step_by_Step assignment on coursera lab, and seems like I couldnt validate some of the exercises, such as exercises from L_model_forward (exercise 5 onwards), even when I had waited for ~10-20 mins for it to validate. Then I tried to submit the whole assignment and got 0/100 with the error message below. Can you help me to address the issue and show me how to fix that? Much thanks!

[ValidateApp | INFO] Validating '/home/jovyan/work/submitted/courseraLearner/W4A1/Building_your_Deep_Neural_Network_Step_by_Step.ipynb'
[ValidateApp | INFO] Executing notebook with kernel: python3
[ValidateApp | ERROR] Timeout waiting for execute reply (30s).
[ValidateApp | ERROR] Interrupting kernel
[ValidateApp | ERROR] Traceback (most recent call last):
      File "/opt/conda/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 589, in run_cell
        msg = self.kc.iopub_channel.get_msg(timeout=timeout)
      File "/opt/conda/lib/python3.7/site-packages/jupyter_client/blocking/channels.py", line 57, in get_msg
        raise Empty
    _queue.Empty
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/apps/validateapp.py", line 72, in start
        validator.validate_and_print(filename)
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/validator.py", line 340, in validate_and_print
        results = self.validate(filename)
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/validator.py", line 311, in validate
        nb = self._preprocess(nb)
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/validator.py", line 290, in _preprocess
        nb, resources = pp.preprocess(nb, resources)
      File "/opt/conda/lib/python3.7/site-packages/nbgrader/preprocessors/execute.py", line 41, in preprocess
        output = super(Execute, self).preprocess(nb, resources)
      File "/opt/conda/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 405, in preprocess
        nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)
      File "/opt/conda/lib/python3.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess
        nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
      File "/opt/conda/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 438, in preprocess_cell
        reply, outputs = self.run_cell(cell, cell_index, store_history)
      File "/opt/conda/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 597, in run_cell
        raise TimeoutError("Timeout waiting for IOPub output")
    TimeoutError: Timeout waiting for IOPub output
    
[ValidateApp | ERROR] nbgrader encountered a fatal error while trying to validate 'submitted/courseraLearner/W4A1/Building_your_Deep_Neural_Network_Step_by_Step.ipynb'
1 Like

A timeout usually means that your code either has an infinite loop, or that your code is taking way too long to run.

The first thing to fix is that running the notebook should not take 20 minutes. So fix that first. Do not try to submit your notebook for grading until you fix that.

So check if your code has any for-loops, and if so, check that they will always terminate when they run out of iterations.

2 Likes

Hmmm I got it, thank you!

1 Like

Hello Thao Phan,

Besides, Tom Mosh sir’s relevant & timely suggestion on Validate app error, you could also check on to other factors like: running low on memory, kernel issues, or network related issues. Sometimes, these reasons become the cause of the said error.

It may also be helpful to run the “Kernel → Restart and clear output” command. If you have a lot of print() output you have added to the notebook, this can clog up the system.

Turned out I had some typo in the caches.append so it made the code become so slow.
It works perfectly to me now. Thank you so much for your help!

That’s good news!