showlab / Image2Paragraph

[A toolbox for fun.] Transform Image into Unique Paragraph with ChatGPT, BLIP2, OFA, GRIT, Segment Anything, ControlNet.
Apache License 2.0
789 stars 53 forks source link

Out of Memory Issue in Semantic Segmentation #11

Open code4indo opened 1 year ago

code4indo commented 1 year ago

Why is it that when working on semantic segmentation, I constantly encounter out of memory errors, even though I have two GPUs with 15GB each? Is it possible to distribute the model workload across the GPUs in parallel?

FingerRec commented 1 year ago

The SAM itself is not heavy. But semantic segment anything requires four large model which is very memory consuming. At now, simply use --semantic_segment_device as 'CPU' to run. We are working on make this model lightweight now.

FingerRec commented 1 year ago

Hi, we have implement a light version.

Can be run on 8G GPU less than 20s.