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: 'GroundingDINO' object is not callable #340

Open
Bowie1026 opened this issue Jun 20, 2024 · 0 comments
Open

TypeError: 'GroundingDINO' object is not callable #340

Bowie1026 opened this issue Jun 20, 2024 · 0 comments

Comments

@Bowie1026
Copy link

Hey everyone, I met with an error when coding on inference_one_img.py
I think it's because when I debug, I change some codes in some file by mistake.
and here's my error.

`def get_grounding_output(model, image, caption, box_threshold, text_threshold=None, with_logits=True, cpu_only=False, token_spans=None):

assert text_threshold is not None or token_spans is not None, "text_threshould and token_spans should not be None at the same time!"
caption = caption.lower()
caption = caption.strip()
if not caption.endswith("."):
    caption = caption + "."
device = "cuda" if not cpu_only else "cpu"
model = model.to(device)
image = image.to(device)
with torch.no_grad():
    outputs = model(image[None], captions=[caption]) `

and my error is

TypeError: 'GroundingDINO' object is not callable

where I shall start with when debuging this error? Thank you for your answer.

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