Spaces:
Runtime error
Runtime error
AttributeError: 'CLIPSegImageSegmentationOutput' object has no attribute 'logits_per_image'
#1
by
Bailey24 - opened
You did great, beautiful work.
But I want to know the image-text similarity score, you said
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities
but I try it, I got the error
logits_per_image = outputs.logits_per_image
AttributeError: 'CLIPSegImageSegmentationOutput' object has no attribute 'logits_per_image'
Please help me.
Hi,
CLIPSegForImageSegmentation returns the following keys: https://github.com/huggingface/transformers/blob/17a7b49bda15353cc49172a0cfeb839a9719e018/src/transformers/models/clipseg/modeling_clipseg.py#L1485
Thank you. It work.
nielsr changed discussion status to
closed