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

"Unused or unrecognized kwargs: padding" error when running notebook example #418

Open
jferments opened this issue May 2, 2024 · 0 comments

Comments

@jferments
Copy link

jferments commented May 2, 2024

When I run the code from the example notebook Zero_shot_image_segmentation_with_CLIPSeg.ipynb:

from PIL import Image
import requests
from transformers import CLIPSegProcessor, CLIPSegForImageSegmentation

url = "https://github.com/timojl/clipseg/blob/master/example_image.jpg?raw=true"
image = Image.open(requests.get(url, stream=True).raw)

processor = CLIPSegProcessor.from_pretrained("CIDAS/clipseg-rd64-refined")
model = CLIPSegForImageSegmentation.from_pretrained("CIDAS/clipseg-rd64-refined")

prompts = ["a glass", "something to fill", "wood", "a jar"]

inputs = processor(text=prompts, images=[image] * len(prompts), padding="max_length", return_tensors="pt")

The sample image and model loads fine, but then I get the following error when calling processor():

Unused or unrecognized kwargs: padding.

@jferments jferments changed the title Unused or unrecognized kwargs: padding when running notebook example "Unused or unrecognized kwargs: padding" error when running notebook example May 2, 2024
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