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

[BUG] Memory Leak maybe? #921

Open mayishazn opened 2 months ago

mayishazn commented 2 months ago

Using the new cellpose denoise cyto3. It seems while running through the model.eval. my machine is using up 15GB RAM. My images are 2048*2048 pixels. They're just not that big. And I set a limit to only parse through 5 images at a time.

image

The notebook I am running is as follows: https://drive.google.com/file/d/1-Wat0MptBA9t4jyKJt9BLUhanU5LrA5t/view?usp=sharing

Any help appreciated! Thanks!!

mayishazn commented 1 month ago

To add more details - I have watched the RAM increase as it went through a batch of 5 images. Even after running: del styles del names del imgs del imgs_dn gc.collect()

the RAM usage remains capped. It seems cellpose itself is hogging memory and not clearing info between processing batches of images.