MouseLand / cellpose

a generalist algorithm for cellular segmentation with human-in-the-loop capabilities
https://www.cellpose.org/
BSD 3-Clause "New" or "Revised" License
1.24k stars 359 forks source link

CellposeGUI Stuck on Draw Masks [BUG] #930

Open mayishazn opened 1 month ago

mayishazn commented 1 month ago

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-20xMII-_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

laurend commented 1 month ago

I also have this bug!

carsen-stringer commented 1 month ago

Sorry, please upgrade, this is fixed in cellpose3

mayishazn commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

Ya this still happens on cellpose3 (even after upgrading)

image

mayishazn commented 1 month ago

image

mayishazn commented 1 month ago

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.

Anto9393 commented 1 week ago

I have exactly the same problem

Anto9393 commented 1 week ago

someone have any solution???

mayishazn commented 1 week ago

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...