1.自行安装jupyter
conda install ipython
conda install jupyter
2.
ipython kernelspec install-self --user
3.
mkdir -p /home/fire/.ipython/kernels
4.
mv /home/fire/.local/share/jupyter/kernels/python3 /home/fire/.ipython/kernels/torch
5.
cd /home/fire/.ipython/kernels/torch/
6.
gedit kernel.json
7.将 display_name 中的默认值 Python 3 改为自己起的名字(torch),然后保存并退出
注意:这里的名字一定要和上面第四步起的名字对应,还有检查第三行的路径是否为安装了Pytorch的Python路径,自己的打开为python路径,里面没有安装pytorch,需修改,否则会报错如下:(名字一定要前后对应)
A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.
/home/fire/Pictures/Screenshot from 2021-01-27 12-16-43.png
错误示范:
正确: 核的名字自己修改,图中与上文命名的torch不一样,按上文因改为torch
参考:https://blog.csdn.net/weixin_41143397/article/details/89923896