Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipython notebook kernel dies ("WebSocket ping timeout") when the SSH connection becomes idle

I was trying to use tmux to start a remote ipython notebook on my Debian server. I then start browser on the Mac OS X local machine. After starting a long-run task, I detach the tmux session and exit the SSH connection.

However, after a while I came back and SSH back to the server, I found the following message in tmux session:

[W 19:15:52.617 NotebookApp] Notebook simplified_algo.ipynb is not trusted      # The first time I left 
[W 19:27:55.249 NotebookApp] WebSocket ping timeout after 119865 ms.  
[I 22:09:13.696 NotebookApp] Saving file at /simplified_algo.ipynb              # I then came back 
[W 22:09:13.698 NotebookApp] Saving untrusted notebook simplified_algo.ipynb
[W 22:15:18.390 NotebookApp] Notebook simplified_algo.ipynb is not trusted
[I 22:17:21.426 NotebookApp] Saving file at /simplified_algo.ipynb
[W 22:17:21.428 NotebookApp] Saving untrusted notebook simplified_algo.ipynb
[I 22:19:20.954 NotebookApp] Saving file at /simplified_algo.ipynb
[I 22:21:20.974 NotebookApp] Saving file at /simplified_algo.ipynb              # The second time I left
[W 22:38:33.102 NotebookApp] WebSocket ping timeout after 119992 ms.
[I 23:01:07.494 NotebookApp] Kernel shutdown: 75b0cf60-610e-4931-99cb-847d821a726b

It seems that the kernel dies when the SSH connection is halted and becomes idle. How can it be fixed? Any comment would be appreciated.

like image 264
Francis Avatar asked Jul 16 '15 02:07

Francis


1 Answers

I've got this error of Websocket timeout (Websocket ping timeout after ... ms) using Keras library with IPython / Jupyter Notebook which is caused by a bug when dealing with progress bar. So you can, one of these solutions:

  1. Simply put verbose=0 in all model.fit(...) instructions

  2. Install keras-tqdm to manage progress bar

  3. Redirect the output to a file

like image 114
Claude COULOMBE Avatar answered Nov 15 '22 22:11

Claude COULOMBE