You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/work/gitee/similarities/examples/image_demo.py", line 67, in
clip_demo()
File "/work/gitee/similarities/examples/image_demo.py", line 51, in clip_demo
sim_scores = m.similarity(imgs, texts)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/gitee/similarities/similarities/imagesim.py", line 129, in similarity
text_emb2 = self._get_vector(b)
^^^^^^^^^^^^^^^^^^^
File "/work/gitee/similarities/similarities/imagesim.py", line 82, in _get_vector
return self.clip_model.encode(text_or_img, batch_size=batch_size, show_progress_bar=show_progress_bar)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/gitee/similarities/similarities/clip_model.py", line 173, in encode
out_features = self.forward(features)
^^^^^^^^^^^^^^^^^^^^^^
File "/work/gitee/similarities/similarities/clip_model.py", line 62, in forward
text_embeds = self.model.text_projection(text_outputs[1])
~~~~~~~~~~~~^^^
File "/home/eli/jvenv2/lib/python3.11/site-packages/transformers/utils/generic.py", line 320, in getitem
return self.to_tuple()[k]
~~~~~~~~~~~~~~~^^^
IndexError: tuple index out of range
The text was updated successfully, but these errors were encountered:
How to fix it?
(jvenv2) eli@sf-5820:/work/gitee/similarities/examples$ python image_demo.py
Similarity: ClipSimilarity, matching_model: CLIPModel
text_outputs= BaseModelOutputWithPoolingAndCrossAttentions(last_hidden_state=tensor([[[-1.1101, -1.0938, 0.4898, ..., -0.0164, -0.6199, -0.0707],
[-0.6594, -0.4225, 0.2657, ..., 0.2450, -0.9777, 0.0150],
[-0.4969, -0.4251, 0.1939, ..., 0.1082, -1.2218, 0.1043],
...,
[-0.5155, -0.2084, 0.2472, ..., -0.1606, -1.1309, -0.5505],
[-0.6670, -0.3467, 0.3174, ..., -0.0138, -1.1362, -0.3339],
[-1.1101, -1.0938, 0.4898, ..., -0.0164, -0.6199, -0.0707]],
Traceback (most recent call last):
File "/work/gitee/similarities/examples/image_demo.py", line 67, in
clip_demo()
File "/work/gitee/similarities/examples/image_demo.py", line 51, in clip_demo
sim_scores = m.similarity(imgs, texts)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/gitee/similarities/similarities/imagesim.py", line 129, in similarity
text_emb2 = self._get_vector(b)
^^^^^^^^^^^^^^^^^^^
File "/work/gitee/similarities/similarities/imagesim.py", line 82, in _get_vector
return self.clip_model.encode(text_or_img, batch_size=batch_size, show_progress_bar=show_progress_bar)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/work/gitee/similarities/similarities/clip_model.py", line 173, in encode
out_features = self.forward(features)
^^^^^^^^^^^^^^^^^^^^^^
File "/work/gitee/similarities/similarities/clip_model.py", line 62, in forward
text_embeds = self.model.text_projection(text_outputs[1])
~~~~~~~~~~~~^^^
File "/home/eli/jvenv2/lib/python3.11/site-packages/transformers/utils/generic.py", line 320, in getitem
return self.to_tuple()[k]
~~~~~~~~~~~~~~~^^^
IndexError: tuple index out of range
The text was updated successfully, but these errors were encountered: