IDEA-Research / Grounded-Segment-Anything

Grounded SAM: Marrying Grounding DINO with Segment Anything & Stable Diffusion & Recognize Anything - Automatically Detect , Segment and Generate Anything
https://arxiv.org/abs/2401.14159
Apache License 2.0
14.85k stars 1.37k forks source link

跑自己图像出现问题 #100

Open jo-dean opened 1 year ago

jo-dean commented 1 year ago

在跑sam的时候,出现下面这个问题

Grounded-Segment-Anything/segment_anything/segment_anything/modeling/mask_decoder.py", line 144, in predict_masks masks = (hyper_in @ upscaled_embedding.view(b, c, h * w)).view(b, -1, h, w) RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1, 256, 256] because the unspecified dimension size -1 can be any value and is ambiguous

917940234 commented 1 year ago

请问你使用python -m pip install -e GroundingDINO安装环境时,电脑自带C++相关环境吗?我现在不清楚我的错误是由其他问题引起的还是由C++环境版本引起的

PoopBear1 commented 1 year ago

I encountered this issue as well

jo-dean commented 1 year ago

@917940234 对的,我之前装了gcc之类的。我跑有的图会出现这个问题

zhang-jr commented 1 year ago

It seems no prompt objects are segmented by sam in your images.

jo-dean commented 1 year ago

应该是的,已经可以了

zhang-jr commented 1 year ago

It seems no prompt objects are segmented by sam in your images.

If there are no output boxes generated by grounding dino, there is no need to apply sampredictor.

PoopBear1 commented 1 year ago

应该是的,已经可以了

Could you kindly share how did you solve this issue? For my cases, this error especially raise when the "prompt-text" is not detected.

solved.

Marcophono2 commented 1 year ago

@PoopBear1 Sharing your knowledge would have been fine.

Dratlan commented 1 year ago

If there is no output for grounding dino, this error occurs.