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: Sam.__call__() got an unexpected keyword argument 'input_image' #1007

Open
rohit901 opened this issue Mar 2, 2024 · 1 comment

Comments

@rohit901
Copy link

rohit901 commented Mar 2, 2024

Hello the demo usage code of sam is giving me this error:
TypeError: Sam.call() got an unexpected keyword argument 'input_image'

Changing line 28 to:

ret = sam_model.apply(
    {'params': params},
    image = input_image,
    point_coords = point_coords,
    point_labels = point_labels,
    padding_mask = padding_mask,
    return_image_embedding=True,
    train=False)

and line 44 to:

ret = sam_model.apply(
    {'params': params},
    image=None,
    point_coords=point_coords,
    point_labels=point_labels,
    padding_mask=padding_mask,
    image_embeddings=cached_image_embedding,
    train=False)

fixes the issue, i.e., passing in "image = " argument when calling the sam_model.

@rohit901
Copy link
Author

rohit901 commented Mar 2, 2024

tagging @xingyizhou

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