[GH-ISSUE #237] weird attention map in Resnet CLIP #205

Open
opened 2026-10-31 21:12:26 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @jihwanp on GitHub (Apr 25, 2022).
Original GitHub issue: https://github.com/openai/CLIP/issues/237

Hi I encoutered some weird attention map when using CLIP image encoder with Resnet (50x4 actually)
Screenshot from 2022-04-25 16-32-00

Above attention map is what I extracted from Resnet attention pooling layer, and it seems that all the tokens are attending to last token which is just local token of last index.

I don't know why this phenomenon happens, and I wonder if anyone has experienced the same phenomenon.

Originally created by @jihwanp on GitHub (Apr 25, 2022). Original GitHub issue: https://github.com/openai/CLIP/issues/237 Hi I encoutered some weird attention map when using CLIP image encoder with Resnet (50x4 actually) ![Screenshot from 2022-04-25 16-32-00](https://user-images.githubusercontent.com/70801434/165042029-fda3c959-9680-4d35-bed4-dfb52eeb6b9f.png) Above attention map is what I extracted from Resnet attention pooling layer, and it seems that all the tokens are attending to last token which is just local token of last index. I don't know why this phenomenon happens, and I wonder if anyone has experienced the same phenomenon.
Author
Owner

@lxkim814 commented on GitHub (Dec 25, 2024):

Hi @jihwanp , I faced the same issue and wanna know whether you figured out how to fix it.

<!-- gh-comment-id:2561881103 --> @lxkim814 commented on GitHub (Dec 25, 2024): Hi @jihwanp , I faced the same issue and wanna know whether you figured out how to fix it.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#205
No description provided.