ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Jupyter matplotlib 画图就kernel died 问题解决

2021-12-07 16:05:15  阅读:670  来源: 互联网

标签:progameFiles kernel Jupyter Anaconda3 envs matplotlib traitlets gpu FutureWarnin


  jupyter一画图就卡死, 类似下面的代码,运行会导致 kernel died    

 

 

  运行如上所示的代码,没有图形出来。实际上看jupyter的log,kernel已经died了 日志如下;    


Info 2021-12-07 15:11:03: Execute Cells request 2 1, 2
Info 2021-12-07 15:11:03: Execute Cell 1 file:///f%3A/pythonCode/juptyerCode//plot2.ipynb
Info 2021-12-07 15:11:03: Execute Cell 2 file:///f%3A/pythonCode/juptyerCode//plot2.ipynb
Info 2021-12-07 15:11:03: KernelProcess output: Content-Length: 137
Content-Type: application/vscode-jsonrpc; charset=utf8

{"jsonrpc": "2.0", "method": "log", "params": {"level": "WARNING", "msg": "Kernel has exited with exit code 3221225477, ", "pid": 22404}}Content-Length: 94
Content-Type: application/vscode-jsonrpc; charset=utf8

{"jsonrpc": "2.0", "method": "kernel_died", "params": {"exit_code": 3221225477, "reason": ""}}
Warn 2021-12-07 15:11:03: Python Daemon (pid: 22404): Kernel has exited with exit code 3221225477,
Error 2021-12-07 15:11:03: Kernel died [s [Error]: Kernel died (code: 3221225477). FutureWarning),
D:\progameFiles\Anaconda3\envs\tf2.1gpu\lib\site-packages\traitlets\traitlets.py:2205: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
FutureWarning)
D:\progameFiles\Anaconda3\envs\tf2.1gpu\lib\site-packages\traitlets\traitlets.py:2160: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '0ac2f1f7-b974-4410-8c29-153e98ff6eb9' instead of 'b"0ac2f1f7-b974-4410-8c29-153e98ff6eb9"'.
FutureWarning)

at c:\Users\Admin\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:793230
at c:\Users\Admin\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:466054
at c:\Users\Admin\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:466272
at Immediate._onImmediate (c:\Users\Admin\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:467837)
at processImmediate (internal/timers.js:461:21)] {
category: 'kerneldied',
stdErr: `D:\\progameFiles\\Anaconda3\\envs\\tf2.1gpu\\lib\\site-packages\\traitlets\\traitlets.py:2205: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.\r\n` +
' FutureWarning)\r\n' +
`D:\\progameFiles\\Anaconda3\\envs\\tf2.1gpu\\lib\\site-packages\\traitlets\\traitlets.py:2160: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '0ac2f1f7-b974-4410-8c29-153e98ff6eb9' instead of 'b"0ac2f1f7-b974-4410-8c29-153e98ff6eb9"'.\r\n` +
' FutureWarning)\r\n',
exitCode: 3221225477,
reason: `D:\\progameFiles\\Anaconda3\\envs\\tf2.1gpu\\lib\\site-packages\\traitlets\\traitlets.py:2205: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.\r\n` +
' FutureWarning)\r\n' +
`D:\\progameFiles\\Anaconda3\\envs\\tf2.1gpu\\lib\\site-packages\\traitlets\\traitlets.py:2160: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '0ac2f1f7-b974-4410-8c29-153e98ff6eb9' instead of 'b"0ac2f1f7-b974-4410-8c29-153e98ff6eb9"'.\r\n` +
' FutureWarning)\r\n'
} D:\progameFiles\Anaconda3\envs\tf2.1gpu\lib\site-packages\traitlets\traitlets.py:2205: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
FutureWarning)
D:\progameFiles\Anaconda3\envs\tf2.1gpu\lib\site-packages\traitlets\traitlets.py:2160: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '0ac2f1f7-b974-4410-8c29-153e98ff6eb9' instead of 'b"0ac2f1f7-b974-4410-8c29-153e98ff6eb9"'.
FutureWarning)

Error 2021-12-07 15:11:03: KernelProcess Exit Exit - 3221225477, D:\progameFiles\Anaconda3\envs\tf2.1gpu\lib\site-packages\traitlets\traitlets.py:2205: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
FutureWarning)
D:\progameFiles\Anaconda3\envs\tf2.1gpu\lib\site-packages\traitlets\traitlets.py:2160: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '0ac2f1f7-b974-4410-8c29-153e98ff6eb9' instead of 'b"0ac2f1f7-b974-4410-8c29-153e98ff6eb9"'.
FutureWarning)
[s [Error]: Kernel died (code: 3221225477). FutureWarning),
D:\progameFiles\Anaconda3\envs\tf2.1gpu\lib\site-packages\traitlets\traitlets.py:2205: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
FutureWarning)
D:\progameFiles\Anaconda3\envs\tf2.1gpu\lib\site-packages\traitlets\traitlets.py:2160: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '0ac2f1f7-b974-4410-8c29-153e98ff6eb9' instead of 'b"0ac2f1f7-b974-4410-8c29-153e98ff6eb9"'.
FutureWarning)

at c:\Users\Admin\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:793230
at c:\Users\Admin\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:466054
at c:\Users\Admin\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:466272
at Immediate._onImmediate (c:\Users\Admin\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:467837)
at processImmediate (internal/timers.js:461:21)] {
category: 'kerneldied',
stdErr: `D:\\progameFiles\\Anaconda3\\envs\\tf2.1gpu\\lib\\site-packages\\traitlets\\traitlets.py:2205: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.\r\n` +
' FutureWarning)\r\n' +
`D:\\progameFiles\\Anaconda3\\envs\\tf2.1gpu\\lib\\site-packages\\traitlets\\traitlets.py:2160: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '0ac2f1f7-b974-4410-8c29-153e98ff6eb9' instead of 'b"0ac2f1f7-b974-4410-8c29-153e98ff6eb9"'.\r\n` +
' FutureWarning)\r\n',
exitCode: 3221225477,
reason: `D:\\progameFiles\\Anaconda3\\envs\\tf2.1gpu\\lib\\site-packages\\traitlets\\traitlets.py:2205: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.\r\n` +
' FutureWarning)\r\n' +
`D:\\progameFiles\\Anaconda3\\envs\\tf2.1gpu\\lib\\site-packages\\traitlets\\traitlets.py:2160: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '0ac2f1f7-b974-4410-8c29-153e98ff6eb9' instead of 'b"0ac2f1f7-b974-4410-8c29-153e98ff6eb9"'.\r\n` +
' FutureWarning)\r\n'
}
Error 2021-12-07 15:11:03: Disposing session as kernel process died ExitCode: 3221225477, Reason: undefined
Info 2021-12-07 15:11:03: Dispose Kernel process
Info 2021-12-07 15:11:03: kill daemon
Info 2021-12-07 15:11:03: KernelProcess output: Content-Length: 132
Content-Type: application/vscode-jsonrpc; charset=utf8

{"jsonrpc": "2.0", "method": "log", "params": {"level": "INFO", "msg": "Execute rpc method kill_kernel in DS Daemon", "pid": 22404}}
Info 2021-12-07 15:11:03: Python Daemon (pid: 22404): Execute rpc method kill_kernel in DS Daemon
Info 2021-12-07 15:11:03: KernelProcess output: Content-Length: 180
Content-Type: application/vscode-jsonrpc; charset=utf8

{"jsonrpc": "2.0", "method": "log", "params": {"level": "INFO", "msg": "Execute rpc method kill_kernel from D:\\progameFiles\\Anaconda3\\envs\\tf2.1gpu\\python.exe", "pid": 22404}}Content-Length: 129
Content-Type: application/vscode-jsonrpc; charset=utf8

{"jsonrpc": "2.0", "method": "log", "params": {"level": "INFO", "msg": "Kill kernel in DS Kernel Launcher Daemon", "pid": 22404}}Content-Length: 140
Content-Type: application/vscode-jsonrpc; charset=utf8

{"jsonrpc": "2.0", "method": "log", "params": {"level": "INFO", "msg": "Kill kernel in DS Kernel Launcher Daemon, pid 39208", "pid": 22404}}Content-Length: 43
Content-Type: application/vscode-jsonrpc; charset=utf8

{"jsonrpc": "2.0", "id": 2, "result": null}
Info 2021-12-07 15:11:03: Python Daemon (pid: 22404): Execute rpc method kill_kernel from D:\progameFiles\Anaconda3\envs\tf2.1gpu\python.exe
Info 2021-12-07 15:11:03: Python Daemon (pid: 22404): Kill kernel in DS Kernel Launcher Daemon
Info 2021-12-07 15:11:03: Python Daemon (pid: 22404): Kill kernel in DS Kernel Launcher Daemon, pid 39208
Info 2021-12-07 15:11:03: Dispose Kernel process
Info 2021-12-07 15:11:03: KernelProcess Exit Exit - 3221225477 D:\progameFiles\Anaconda3\envs\tf2.1gpu\lib\site-packages\traitlets\traitlets.py:2205: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
FutureWarning)
D:\progameFiles\Anaconda3\envs\tf2.1gpu\lib\site-packages\traitlets\traitlets.py:2160: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '0ac2f1f7-b974-4410-8c29-153e98ff6eb9' instead of 'b"0ac2f1f7-b974-4410-8c29-153e98ff6eb9"'.
FutureWarning)

    看到一篇文章:   kernel dead 用pytorch学习深度学习,运行老师给的代码,每次遇到要画图的环节,jupyter notebook一言不合就内核挂掉了…   试错 全网找解决方案,jupyter、ipkernel什么的全都是最新版本,anaconda分配内存、docket分配内存啥的全都试了一遍…试了整个晚上,都没有用。。心累   解决方案 ———————————————— 版权声明:本文为CSDN博主「时透透郎酱」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/qq_43471082/article/details/119191052         最后我在 在stackoverflow上面找到了答案: https://stackoverflow.com/questions/65734044/kernel-appears-to-have-died-jupyter-notebook-python-matplotlib   0 I try the solution of this video, based on this post, and it worked for me:
  • Run Anaconda Prompt as administrator
  • conda install --yes freetype=2.10.4
    我最开始freetype没有限定版本, conda install --yes freetype 还是报错。按照上面的限定了版本号 2.10.4 。就解决问题了。   Matplotlib依赖freetype库。                  

标签:progameFiles,kernel,Jupyter,Anaconda3,envs,matplotlib,traitlets,gpu,FutureWarnin
来源: https://www.cnblogs.com/youxin/p/15656557.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有