-
Hi all, I am in the process of segmenting a drone orthophoto (226Mb) that covers around 5ha, reprocessed at 10cm per pixel. I have tested the text prompt segmentation and pin prompt segmentation with poor results. Now I am testing the general segmentation of the whole mosaic. But I have found errors related to memory use when conducting the process. I am using I have around 20Gb of ram memory available and I am not using GPUs. I am wondering if there is a way to limit memory usage to avoid this kind of issue. See the error below: `RuntimeError Traceback (most recent call last) File ~\miniconda3\envs\geo\lib\site-packages\samgeo\samgeo.py:208, in SamGeo.generate(self, source, output, foreground, batch, erosion_kernel, mask_multiplier, unique, **kwargs) File ~\miniconda3\envs\geo\lib\site-packages\torch\autograd\grad_mode.py:27, in _DecoratorContextManager.call..decorate_context(*args, **kwargs) File ~\miniconda3\envs\geo\lib\site-packages\segment_anything\automatic_mask_generator.py:163, in SamAutomaticMaskGenerator.generate(self, image) File ~\miniconda3\envs\geo\lib\site-packages\segment_anything\automatic_mask_generator.py:206, in SamAutomaticMaskGenerator._generate_masks(self, image) File ~\miniconda3\envs\geo\lib\site-packages\segment_anything\automatic_mask_generator.py:245, in SamAutomaticMaskGenerator._process_crop(self, image, crop_box, crop_layer_idx, orig_size) File ~\miniconda3\envs\geo\lib\site-packages\segment_anything\automatic_mask_generator.py:297, in SamAutomaticMaskGenerator._process_batch(self, points, im_size, crop_box, orig_size) File ~\miniconda3\envs\geo\lib\site-packages\segment_anything\utils\amg.py:49, in MaskData.filter(self, keep) RuntimeError: [enforce fail at C:\b\abs_f0dma8qm3d\croot\pytorch_1669187301762\work\c10\core\impl\alloc_cpu.cpp:81] data. DefaultCPUAllocator: not enough memory: you tried to allocate 49592930604 bytes. Any ideas or leads are appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This seems a SAM issue rather than samgeo. Under the hood, samgeo class segment_anything\automatic_mask_generator.py to segment the image. The memory is managed by SAM. You can open an issue at https://github.com/facebookresearch/segment-anything |
Beta Was this translation helpful? Give feedback.
This seems a SAM issue rather than samgeo. Under the hood, samgeo class segment_anything\automatic_mask_generator.py to segment the image. The memory is managed by SAM. You can open an issue at https://github.com/facebookresearch/segment-anything