用jupyter在pytorch上跑3D Unet时遇到kernel crashed的问题
Canceled future for execute_request message before replies were done
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"
参考:
https://blog.csdn.net/AdamCY888/article/details/129725656
https://blog.csdn.net/Ky_11111/article/details/120635990
https://blog.csdn.net/kkz2756275580/article/details/125124646
二、尝试解决方案二
重装环境,使用conda install
,而不是使用pip install
重装了多次环境仍然不能解决问题
参考:
https://github.com/microsoft/vscode-jupyter/wiki/Kernel-crashes-when-using-numpy
https://github.com/microsoft/vscode-jupyter/wiki/Kernel-crashes
https://github.com/microsoft/vscode-jupyter/issues/10827
三、 减少内存使用
在加载数据时将CacheDataset改为Dataset,不再报错,即该问题的由于内存超出产生的。