Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can use multi-boxes prompt to fine-tune SAM? #775

Open
wu2233 opened this issue Sep 18, 2024 · 0 comments
Open

can use multi-boxes prompt to fine-tune SAM? #775

wu2233 opened this issue Sep 18, 2024 · 0 comments

Comments

@wu2233
Copy link

wu2233 commented Sep 18, 2024

 Hello, I hope to use multi-boxes prompts to fine-tune SAM (not for prediction). Assuming my training batch size is set to 2, that is, two images, and each image has 3 prompt boxes, so I created my prompt tensor with input_boxes = torch.randn(2,3,4).to('cuda'), but I encountered this error in the prompt_encoder.py:

sparse_embeddings = torch.cat([sparse_embeddings, box_embeddings], dim=1)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 2 but got size 6 for tensor number 1 in the list.
I am not sure the shape of 'input boxes tensor' should be (3,4) or (2,3,4). The former is OK for the program, but the latter is throwing the error. I hope to get some help, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant