joonkeekim / mediar-napari

BSD 3-Clause "New" or "Revised" License
20 stars 1 forks source link

3D+2Ch sample gives OutOfMemoryError #3

Open macromeer opened 6 months ago

macromeer commented 6 months ago

Hi there. Running mediar on the provided 3D+2Ch cell sample gives me the below error. I did not have time to go through the code, but I've noticed that it tries to allocate most of the VRAM more than once. I've also noticed that running mediar on a multichannel 2D image provokes a similar behaviour, while a 2D RGB image (conforming to your 2D sample) is segmented w/o any issues.

OutOfMemoryError: CUDA out of memory. Tried to allocate 37.50 GiB. GPU 0 has a total capacity of 44.53 GiB of which 4.67 GiB is free. Process 1818 has 264.07 MiB memory in use. Including non-PyTorch memory, this process has 38.34 GiB memory in use. Of the allocated memory 37.96 GiB is allocated by PyTorch, and 19.14 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)