MouseLand/cellpose

[BUG] Memory Leak maybe?

Closed this issue · 2 comments

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

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.

if the model is on the CPU then it will stay in RAM, we are working on improving memory usage so I will close this issue for now but let us know if you have more questions