cellpose icon indicating copy to clipboard operation
cellpose copied to clipboard

CellposeGUI Stuck on Draw Masks [BUG]

Open mayishazn opened this issue 1 year ago • 10 comments

Describe the bug I have reinstalled cellpose 2. When I try to draw masks I right click and I see the red circle. I draw the mask and finish at the circle. The circle then disappears but no new mask appears. Instead the purple dots that indicate you are actively drawing an outline still appear. I noticed after returning to the red circle and the circle disappears, any additional movement of the cursor prints "QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0)"

To Reproduce Steps to reproduce the behavior:

  1. right click to start drawing a mask
  2. move mouse around a cell and return to red circle

Run log (cellpose2) C:\Users\mayis>cellpose --verbose 2024-05-02 02:17:15,805 [INFO] WRITING LOG OUTPUT TO C:\Users\mayis.cellpose\run.log 2024-05-02 02:17:16,473 [INFO] TORCH CUDA version not installed/working. (2048, 2048, 4) GUI_INFO: auto-adjust enabled, computing saturation levels GUI_INFO: loaded in previous changes GUI_INFO: 402 masks found in C:/Users/mayis/Downloads/C3-20x_MII_-_dapi_betacat-488_p120-568_ph633-02-0001_seg.npy QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0) QGraphicsScene::removeItem: item 0x1d8259b8340's scene (0x0) is different from this scene (0x1d827c093d0)

For the environment info: env2.txt

mayishazn avatar May 02 '24 07:05 mayishazn

I also have this bug!

laurend avatar May 06 '24 20:05 laurend

Sorry, please upgrade, this is fixed in cellpose3

carsen-stringer avatar May 06 '24 20:05 carsen-stringer

Well part of the reason I wanted to fix masks in cellpose2 is because cellpose3 takes up all my RAM. (See suspected memory leak issue: https://github.com/MouseLand/cellpose/issues/921

mayishazn avatar May 07 '24 21:05 mayishazn

Also it seems this still sometimes but thankfully not always happens on cellpose3. Or like I'll draw the mask and it doesnt show up. -Particularly when editing a single frame of a zstack.

mayishazn avatar May 07 '24 21:05 mayishazn

Ya this still happens on cellpose3 (even after upgrading)

image

mayishazn avatar May 27 '24 07:05 mayishazn

image

mayishazn avatar May 27 '24 07:05 mayishazn

So what seems to work but isn't great is I reinstalled cellpose 1, went in the source code and swapped all the instances of np.bool to bool and np.float to float, and now I can finally draw masks. The workflow is now segment things with the python notebook with cellpose 3, fix the masks in cellpose 1, export them in cellpose 3...

For what its worth I can sometimes get cellpose3 to draw exactly one mask before it gets stuck in draw mode, save, close cellpose, reopen cellpose3 and draw another mask but thats tedious as heck. I suppose one could compare the gui parts of both source codes and see where cellpose 3 gets stuck on draw mode but I'm not too confident if I'll be able to fix it that way.

mayishazn avatar May 27 '24 20:05 mayishazn

I have exactly the same problem

Anto9393 avatar Jun 18 '24 16:06 Anto9393

someone have any solution???

Anto9393 avatar Jun 18 '24 19:06 Anto9393

someone have any solution???

So what seems to work but isn't great is I reinstalled cellpose 1 (pip install cellpose==1.*), went in the source code and swapped all the instances of np.bool to bool and np.float to float, and now I can finally draw masks. The workflow is now segment things with the python notebook with cellpose 3, fix the masks in cellpose 1, export them in cellpose 3...

mayishazn avatar Jun 19 '24 05:06 mayishazn

sorry I haven't been able to replicate this in windows, mac and linux with python=3.10 and python=3.11, please try upgrading, there are some suggestions in #961 , that issue will remain open until this is resolved

carsen-stringer avatar Sep 10 '24 08:09 carsen-stringer