Jupyter notebook shows that the connection fails, the server is busy, and the solution to the kernel error

Does the following interface appear when you open jupyter notebook?

At this moment, you are like the second emoticon package in your mobile phone

        The reason for this situation is that I was participating in the US competition at the time, and I had to run a table with more than 2,000 rows. Seeing that the code block was always in the running * state, I lost my patience and thought that the network card had crashed. Decisively choose to exit the browser and then re-enter, and then the problem shown in the figure above appeared. I also searched a lot of information on the Internet. If there is anything on it, you can just open the terminal and exit the python process. What else can you reinstall jupyter, and even reinstall Anaconda? After I tried all these, I can describe them in one word , "It's nothing!!!"

Next, go directly to the dry goods:

          First of all, when this happens, the first thing we need to do is to check the error log, what? You still don't know what an error log is? WTF? It's this thing:

                 

 After opening this, you can find a sentence on it called:

Kernel started :Kernel error restart (1/5)

This means that your kernel has crashed. Like the editor, you may be running a very large project and the kernel is full. Don’t panic at this time. You just need to follow the steps below to change the kernel. .

1. Change the environment first

The base in the figure is our default environment, and then we will replace it with the torch environment.

First enter conda create -n torch python=3.6 on the command line to create the environment

Then activate the environment activate torch (some computers input conda activate torch, depending on the situation)

 

 When the red box shown above appears, it means that the installation has been completed.

2. Install the kernel in the new environment

Type python -m ipykernel install --user

 This is because I have already installed it, so the displayed kernel already exists

3. Open jupyter notebook and switch torch kernel

 4. Debugging is successful

 If you also debug successfully, don’t forget to give the blogger a double link

Guess you like

Origin blog.csdn.net/weixin_47062899/article/details/123245186
Recommended