CASIA-IVA-Lab / FastSAM

Fast Segment Anything
GNU Affero General Public License v3.0
7.34k stars 682 forks source link

hwo to integrate sahi for high resolution image? CUDA out of memory #188

Open zouxiaodong opened 10 months ago

zouxiaodong commented 10 months ago

hwo to integrate with sahi for high resolution image(5472x2648) has some samll objects?

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 16.06 GiB. GPU 0 has a total capacty of 23.87 GiB of which 13.69 GiB is free. Including non-PyTorch memory, this process has 10.17 GiB memory in use. Of the allocated memory 8.49 GiB is allocated by PyTorch, and 920.86 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

spped2000 commented 5 months ago

Do you have code that FastSAM intregated to SAHI?