segment-anything icon indicating copy to clipboard operation
segment-anything copied to clipboard

The problem of Batch size!=1

Open yangyang1018 opened this issue 3 months ago • 1 comments

When I set the batch size to 2, 3, or any number other than 1, I encounter the following error: RuntimeError: The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 0. This occurs in segment_everything/modeling/mask_decoder.py on line 127 during the execution of predict_masks, specifically at src = src + dense_prompt_embeddings.

This version improves clarity and flow.

yangyang1018 avatar Sep 25 '25 12:09 yangyang1018

I'm also interested in batches of images

MohammadElSakka avatar Sep 26 '25 12:09 MohammadElSakka