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

TypeError: predict() got an unexpected keyword argument 'remove_combined' #64

Closed
kulkarnikeerti opened this issue Jun 21, 2024 · 5 comments · Fixed by #73
Closed

TypeError: predict() got an unexpected keyword argument 'remove_combined' #64

kulkarnikeerti opened this issue Jun 21, 2024 · 5 comments · Fixed by #73

Comments

@kulkarnikeerti
Copy link

kulkarnikeerti commented Jun 21, 2024

Hello,

First of all thanks for the great work. I ran python3 running_test.py and I get the following error
TypeError: predict() got an unexpected keyword argument 'remove_combined'

Could you please suggest the possible solution for this? Thanks in advance

@healthonrails @kauevestena @mutusfa @siddharthksah @dolhasz

Update: The script works fine without this argument. Could you please let me know how this argument influences the output of the model?

@kauevestena
Copy link
Contributor

Thanks for the interest!

But I couldn't find this argument in the code; in which line does that appear?

@kulkarnikeerti
Copy link
Author

remove_combined=self.return_prompts,

Please find the line here

@kauevestena
Copy link
Contributor

kauevestena commented Jun 25, 2024

The default constructor states it as false, so it doesn't seems to make a difference:

https://github.com/IDEA-Research/GroundingDINO/blob/df5b48a3efbaa64288d8d0ad09b748ac86f22671/groundingdino/util/inference.py#L53

@luca-medeiros
Copy link
Owner

you may need to upgrade gdino to latest version to solve the issue.

@bryanbocao
Copy link

bryanbocao commented Aug 2, 2024

@kulkarnikeerti

I got the same error but did not upgrade GroundingDINO yet. A quick walkaround solution is to comment the remove_combinedargument out (not tested the side effect)

    def predict_dino(self, image_pil, text_prompt, box_threshold, text_threshold):
        image_trans = transform_image(image_pil)
        boxes, logits, phrases = predict(model=self.groundingdino,
                                         image=image_trans,
                                         caption=text_prompt,
                                         box_threshold=box_threshold,
                                         text_threshold=text_threshold,
                                         # remove_combined=self.return_prompts,
                                         device=self.device)
        W, H = image_pil.size
        boxes = box_ops.box_cxcywh_to_xyxy(boxes) * torch.Tensor([W, H, W, H])

        return boxes, logits, phrases

@luca-medeiros luca-medeiros linked a pull request Oct 12, 2024 that will close this issue
5 tasks
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

Successfully merging a pull request may close this issue.

4 participants