tiatoolbox icon indicating copy to clipboard operation
tiatoolbox copied to clipboard

Kernel keeps dying while trying to create image masks

Open ShataDg opened this issue 1 year ago • 2 comments

  • TIA Toolbox version: 1.5.1
  • Python version: 3.9.18
  • Operating System: Win10

Description

I was trying out the 01-wsi-reading notebook, and kept receiving the message that the kernel has died.

What I Did

I could execute all the steps up to 'Read Bound', but when running the following code to create masks, the kernel kept dying.

`mask_reader = reader.tissue_mask(resolution=4, units="mpp")
mask_thumbnail = mask_reader.slide_thumbnail(resolution=1.25, units="power")

plt.imshow(mask_thumbnail)
plt.show()`

##Jupyter logs

`23:46:59.069 [info] Process Execution: ~\anaconda3\envs\tiatoolbox-dev\python.exe -c "import ipykernel; print(ipykernel.version); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.file)" 23:46:59.080 [info] Process Execution: ~\anaconda3\envs\tiatoolbox-dev\python.exe -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v2-17016QapN6Atk3vtt.json > cwd: ~\anaconda3\envs\tiatoolbox 23:46:59.081 [info] Kernel process 4124. 23:47:00.342 [info] Restarted f8ccd89e-cff5-4ef6-9304-24dd694ec459 23:47:06.191 [info] Handle Execution of Cells 0 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:06.196 [info] Kernel acknowledged execution of cell 0 @ 1709700426196 23:47:06.215 [info] End cell 0 execution after 0.019s, completed @ 1709700426215, started @ 1709700426196 23:47:07.510 [info] Handle Execution of Cells 1 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:07.518 [info] Kernel acknowledged execution of cell 1 @ 1709700427517 23:47:07.522 [info] End cell 1 execution after 0.005s, completed @ 1709700427522, started @ 1709700427517 23:47:09.005 [info] Handle Execution of Cells 2 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:09.010 [info] Kernel acknowledged execution of cell 2 @ 1709700429010 23:47:09.029 [info] End cell 2 execution after 0.019s, completed @ 1709700429029, started @ 1709700429010 23:47:10.624 [info] Handle Execution of Cells 3 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:10.631 [info] Kernel acknowledged execution of cell 3 @ 1709700430630 23:47:11.209 [info] End cell 3 execution after 0.579s, completed @ 1709700431209, started @ 1709700430630 23:47:11.668 [info] Handle Execution of Cells 4 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:11.675 [info] Kernel acknowledged execution of cell 4 @ 1709700431674 23:47:15.299 [info] End cell 4 execution after 3.625s, completed @ 1709700435299, started @ 1709700431674 23:47:16.096 [info] Handle Execution of Cells 5 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:16.102 [info] Kernel acknowledged execution of cell 5 @ 1709700436102 23:47:16.156 [info] End cell 5 execution after 0.052s, completed @ 1709700436154, started @ 1709700436102 23:47:18.236 [info] Handle Execution of Cells 5 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:18.243 [info] Kernel acknowledged execution of cell 5 @ 1709700438242 23:47:18.265 [info] End cell 5 execution after 0.023s, completed @ 1709700438265, started @ 1709700438242 23:47:20.234 [info] Handle Execution of Cells 6 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:20.241 [info] Kernel acknowledged execution of cell 6 @ 1709700440241 23:47:20.248 [info] End cell 6 execution after 0.007s, completed @ 1709700440248, started @ 1709700440241 23:47:22.299 [info] Handle Execution of Cells 7 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:22.306 [info] Kernel acknowledged execution of cell 7 @ 1709700442306 23:47:22.440 [info] End cell 7 execution after 0.134s, completed @ 1709700442440, started @ 1709700442306 23:47:24.200 [info] Handle Execution of Cells 8 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:24.209 [info] Kernel acknowledged execution of cell 8 @ 1709700444208 23:47:24.214 [info] End cell 8 execution after 0.006s, completed @ 1709700444214, started @ 1709700444208 23:47:26.746 [info] Handle Execution of Cells 9 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:26.754 [info] Kernel acknowledged execution of cell 9 @ 1709700446753 23:47:27.238 [info] End cell 9 execution after 0.485s, completed @ 1709700447238, started @ 1709700446753 23:47:29.895 [info] Handle Execution of Cells 10 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:29.903 [info] Kernel acknowledged execution of cell 10 @ 1709700449903 23:47:30.177 [info] End cell 10 execution after 0.273s, completed @ 1709700450176, started @ 1709700449903 23:47:34.009 [info] Handle Execution of Cells 11 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:34.018 [info] Kernel acknowledged execution of cell 11 @ 1709700454018 23:47:34.291 [info] End cell 11 execution after 0.272s, completed @ 1709700454290, started @ 1709700454018 23:47:37.594 [info] Handle Execution of Cells 12 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:37.604 [info] Kernel acknowledged execution of cell 12 @ 1709700457604 23:47:37.810 [info] End cell 12 execution after 0.204s, completed @ 1709700457808, started @ 1709700457604 23:47:40.726 [info] Handle Execution of Cells 13 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:47:40.732 [info] Kernel acknowledged execution of cell 13 @ 1709700460732 23:47:43.573 [warn] StdErr from Kernel Process LLVM ERROR: Symbol not found: __svml_sqrtf8 23:47:43.854 [error] Disposing session as kernel process died ExitCode: 3221226505, Reason: LLVM ERROR: Symbol not found: __svml_sqrtf8

23:47:43.854 [info] Dispose Kernel process 4124. 23:47:43.889 [info] End cell 13 execution after -1709700460.732s, completed @ undefined, started @ 1709700460732 23:54:25.092 [info] Handle Execution of Cells 13 for ~\anaconda3\envs\tiatoolbox\TIAToolbox.ipynb 23:54:27.649 [error] Error in execution Error: The kernel 'tiatoolbox-dev (Python 3.9.18)' died. Click here for more info. View Jupyter log for further details. > Kernel Id = .jvsc74a57bd0d6a0f250f289757d0cb336499c638afe394ce9f8c41d982780761964b15f22ee.~\anaconda3\envs\tiatoolbox-dev\python.exe.~\anaconda3\envs\tiatoolbox-dev\python.exe.-m#ipykernel_launcher > Interpreter Id = ~\ANACONDA3\ENVS\TIATOOLBOX-DEV\PYTHON.EXE > at r.verifyKernelState (~.vscode\extensions\ms-toolsai.jupyter-2024.2.0-win32-x64\dist\extension.node.js:341:54560) > originalException = undefined 23:54:27.649 [error] Error in execution (get message for cell) Error: The kernel 'tiatoolbox-dev (Python 3.9.18)' died. Click here for more info. View Jupyter log for further details. > Kernel Id = .jvsc74a57bd0d6a0f250f289757d0cb336499c638afe394ce9f8c41d982780761964b15f22ee.~\anaconda3\envs\tiatoolbox-dev\python.exe.~\anaconda3\envs\tiatoolbox-dev\python.exe.-m#ipykernel_launcher > Interpreter Id = ~\ANACONDA3\ENVS\TIATOOLBOX-DEV\PYTHON.EXE > at r.verifyKernelState (~.vscode\extensions\ms-toolsai.jupyter-2024.2.0-win32-x64\dist\extension.node.js:341:54560) > originalException = undefined`

ShataDg avatar Mar 06 '24 04:03 ShataDg

It looks like an environment issue. Some similar issues when using conda have been fixed by pip uninstalling openslide-python and re-installing it using conda instead:

pip uninstall openslide-python
conda install -c conda-forge openslide-python

If that doesn't help I don't have any other suggestions at the moment. Does the problem occur only in jupyter notebooks, or more generally too?

measty avatar Mar 11 '24 12:03 measty

Will give this a try. I have only tried in Jupyter notebook so far. Didn't have this issue however on my mac M2 using Jupyter notebook.

ShataDg avatar Mar 12 '24 23:03 ShataDg

Will give this a try. I have only tried in Jupyter notebook so far. Didn't have this issue however on my mac M2 using Jupyter notebook.

@ShataDg did this fix the issue? I'm running into the same problem, but installing openslide-python with conda did not help.

EDIT: It seems to have been a problem with importing umap. I deleted a dll file and everything works now. I was had the same issue discussed here - https://github.com/lmcinnes/umap/issues/702#issuecomment-1005687688

viabard avatar Feb 26 '25 15:02 viabard