Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] merging cells sometimes freeezes cellpose/system #724

Open
jan-glx opened this issue Jun 8, 2023 · 6 comments
Open

[BUG] merging cells sometimes freeezes cellpose/system #724

jan-glx opened this issue Jun 8, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@jan-glx
Copy link

jan-glx commented Jun 8, 2023

In cellpose v2.2.2 and current main, under windows, w/o CUDA, trying to merge objects with (alt+click & alt+click) leads to memory spike of varying size (0 to > 20 GB).

To Reproduce
open an image, add labels, observe system memory while merging two labels (with alt+click & alt+click)

Run log

(cellpose2) C:\Users\jan>python -m cellpose --verbose
2023-06-08 11:27:49,716 [INFO] WRITING LOG OUTPUT TO C:\Users\jan\.cellpose\run.log
2023-06-08 11:27:49,716 [INFO]
cellpose version:       2.2.2
platform:               win32
python version:         3.11.3
torch version:          2.0.1+cpu
2023-06-08 11:27:50,639 [INFO] TORCH CUDA version not installed/working.
GUI_INFO: loading image: C:/1_nobackup/0data/new_microscopy_out/JGG_163_SSOC_4x_3d_BF_1/A_1_fld_1_focused.tif
(1998, 2002, 4)
GUI_INFO: auto-adjust enabled, computing saturation levels
GUI_INFO: 1 ROIs saved to C:/1_nobackup/0data/new_microscopy_out/JGG_163_SSOC_4x_3d_BF_1/A_1_fld_1_focused_seg.npy
GUI_INFO: 2 ROIs saved to C:/1_nobackup/0data/new_microscopy_out/JGG_163_SSOC_4x_3d_BF_1/A_1_fld_1_focused_seg.npy
GUI_INFO: removed cell 1
GUI_INFO: 1 ROIs saved to C:/1_nobackup/0data/new_microscopy_out/JGG_163_SSOC_4x_3d_BF_1/A_1_fld_1_focused_seg.npy
GUI_INFO: merged two cells
GUI_INFO: 1 ROIs saved to C:/1_nobackup/0data/new_microscopy_out/JGG_163_SSOC_4x_3d_BF_1/A_1_fld_1_focused_seg.npy
GUI_INFO: 2 ROIs saved to C:/1_nobackup/0data/new_microscopy_out/JGG_163_SSOC_4x_3d_BF_1/A_1_fld_1_focused_seg.npy

system almost froze after starting second merge (see screenshots).

Screenshots
image

image

@jan-glx jan-glx added the bug Something isn't working label Jun 8, 2023
@mrariden mrariden self-assigned this Jun 8, 2023
@jan-glx
Copy link
Author

jan-glx commented Jun 9, 2023

Just tested this on another system. Same problem. It's a more powerful machine. Here, all 60 GB RAM will be used by cellpose for a few minutes at times, when merging labels.

cellpose version:     2.2 
platform:           win32 
python version:     3.8.16 
torch version:      1.12.0
2023-06-09 17:40:33,058 [INFO] ** TORCH CUDA version installed and working. **
2023-06-09 17:52:40,569 [INFO] >> cyto2 << model set to be used
2023-06-09 17:52:40,585 [INFO] ** TORCH CUDA version installed and working. **
2023-06-09 17:52:40,585 [INFO] >>>> using GPU

@jan-glx
Copy link
Author

jan-glx commented Jun 9, 2023

😅 looking at the code cellpose-noob-I realized that one can select objects. Selecting an object with left click and merging it with another by clicking the other one now while holding alt works fine (not particularly but sufficiently fast). So, the issue only manifests when trying to merge objects with objects with alt+click & alt+click.

@carsen-stringer
Copy link
Member

oh that's very weird thanks for tracking this down, will look into it

@anoshqa
Copy link

anoshqa commented Apr 21, 2024

I had been facing the same problem. Is there any way we can merge masks using Jupyter? I create masks in batch in Jupyter but need to use GUI to merge masks. Also the GUI Alt+click was working few days back and though it was slow (as mentioned) - sometimes it took a very long time and freezed everything, however now I am trying to use Alt+click its not working. I would be really grateful if you found a fix for this! Thank you

@jan-glx
Copy link
Author

jan-glx commented Apr 21, 2024

😅 looking at the code cellpose-noob-I realized that one can select objects. Selecting an object with left click and merging it with another by clicking the other one now while holding alt works fine (not particularly but sufficiently fast). So, the issue only manifests when trying to merge objects with objects with alt+click & alt+click.

@anoshqa -did you try this? If there is no reaction at all, make sure the alt key is actually working. Also, probably no the issue here, but some other programs have issues correctly tracking the alt key state when switching windows with alt+tab.

@anoshqa
Copy link

anoshqa commented Apr 24, 2024

Hi Jan, I cannot understand what you mean by selecting objects in a row. I can't seem to select 2 cells in a row and merge them. I select one cell by left click and then when I click on another, the previous selection goes away. I tried using shift but then the brush button starts. I will make sure Alt key works, my PC actually hanged today after I attempted Alt+Click - I believe its because of big image size and this bug that you mentioned that Alt + Click takes too much of memory sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants