DeadKernelError when submitting C1W1 Logistic_Regression_with_a_Neural_Network_mindset

Hello :slight_smile: I am having problems submitting the first assignment of the course, it cannot be graded, the kernel dies.

The error is cryptic.

[ValidateApp | INFO] Validating '/home/jovyan/work/submitted/courseraLearner/W2A2/Logistic_Regression_with_a_Neural_Network_mindset.ipynb'
[ValidateApp | INFO] Executing notebook with kernel: python3
[ValidateApp | ERROR] Timeout waiting for execute reply (30s).
[ValidateApp | ERROR] Interrupting kernel
[ValidateApp | ERROR] Timeout waiting for execute reply (30s).
[ValidateApp | ERROR] Interrupting kernel
[ValidateApp | ERROR] Kernel died while waiting for execute reply.
[ValidateApp | ERROR] Traceback (most recent call last):
      File "/opt/conda/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 478, in _poll_for_reply
        msg = self.kc.shell_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/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 578, in run_cell
        exec_reply = self._poll_for_reply(parent_msg_id, cell, timeout)
      File "/opt/conda/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 483, in _poll_for_reply
        self._check_alive()
      File "/opt/conda/lib/python3.7/site-packages/nbconvert/preprocessors/execute.py", line 510, in _check_alive
        raise DeadKernelError("Kernel died")
    nbconvert.preprocessors.execute.DeadKernelError: Kernel died
    
    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 44, in preprocess
        raise UnresponsiveKernelError()
    nbgrader.preprocessors.execute.UnresponsiveKernelError
    
[ValidateApp | ERROR] nbgrader encountered a fatal error while trying to validate 'submitted/courseraLearner/W2A2/Logistic_Regression_with_a_Neural_Network_mindset.ipynb'

I also tried what Paul Mielke said in FAQ: Frequently Asked Questions for all DLS Courses

Kernel -> Restart & Clear Output
File -> Save and Checkpoint
Submit Assignment

I don’t know what else to try.

hi @eulersson

First of all thank you for posting such a detailed explanation of your issues and steps you took to resolve your issue.

A kernel usually dies when it is not able to run all the codes in the cell within the designated (30s) time when you run a code cell.

So kindly check if you have not hard coded any implementation in your notebook.

Regards

Dr. Deepti

Perhaps your code accidentally has an infinite loop, or is outputting too much data to the console such that the kernel slows down.

I solved it… I had a wrong axis=1 in sum in the cost function…

I had to redo it from scratch. Very strange.

It would be nice to have feedback on what computation it crashed. But still sometimes it would not be enough to figure out…

If this could be seen live would be very beneficial….

Anyway I’ll move on.

Thanks for the swift responses!

2 Likes

Glad you were able to fix it.