Jupytermatplotlib画图就kerneldied问题解决
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\\", "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.
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)
exited看到⼀篇⽂章:
kernel dead
⽤pytorch学习深度学习,运⾏⽼师给的代码,每次遇到要画图的环节,jupyter notebook⼀⾔不合就内核挂掉了…
试错
全⽹解决⽅案,jupyter、ipkernel什么的全都是最新版本,anaconda分配内存、docket分配内存啥的全都试了⼀遍…试了整个晚上,都没有⽤。。⼼累
解决⽅案
————————————————
版权声明:本⽂为CSDN博主「时透透郎酱」的原创⽂章,遵循CC 4.0 BY-SA版权协议,转载请附上原⽂出处链接及本声明。
原⽂链接:
最后我在
在stackoverflow上⾯到了答案:
I try the solution of this , based on this , 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库。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论