最近在jupyter notebook(window系统)上画图,很容易出现一个bug,导致内核崩掉,如下:
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details.
这里记录一下如何解决。
import os
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
画图前导入这两行代码,这两行代码是用于解决 OpenMP 库冲突 的常见配置,尤其在使用 PyTorch、NumPy、Scikit-learn 等依赖 OpenMP 的库时可能遇到。当然更根本的解决方式是统一环境中 OpenMP 库的版本(例如通过 conda install libiomp5md 统一安装,或卸载冲突的库)。
1176

被折叠的 条评论
为什么被折叠?



