[GH-ISSUE #473] out proj weight typo fix #400

Open
opened 2026-10-31 21:14:41 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @louiswang524 on GitHub (Nov 5, 2024).
Original GitHub issue: https://github.com/openai/CLIP/issues/473

Here is a typo for initialize_parameter() function. The output_proj.weight should be output_proj_weight
github.com/openai/CLIP@dcba3cb2e2/clip/model.py (L321)

Originally created by @louiswang524 on GitHub (Nov 5, 2024). Original GitHub issue: https://github.com/openai/CLIP/issues/473 Here is a typo for initialize_parameter() function. The `output_proj.weight` should be `output_proj_weight` https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L321
Author
Owner

@99991 commented on GitHub (Jan 23, 2025):

What makes you think so?

<!-- gh-comment-id:2609778672 --> @99991 commented on GitHub (Jan 23, 2025): What makes you think so?
Author
Owner

@louiswang524 commented on GitHub (Jan 28, 2025):

What makes you think so?

@99991 before it is a parameter defined here github.com/openai/CLIP@dcba3cb2e2/clip/model.py (L85)

<!-- gh-comment-id:2620257867 --> @louiswang524 commented on GitHub (Jan 28, 2025): > What makes you think so? @99991 before it is a parameter defined here https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L85
Author
Owner

@99991 commented on GitHub (Jan 29, 2025):

The line from your first message initializes the member block.attn.out_proj.weight of self.transformer.resblocks

But in your last message, you highlight self.c_proj.weight, which is not a member of self.transformer.resblocks. Instead, it is a member of AttentionPool2d, which is only used in ModifiedResNet, i.e. self.visual of CLIP.

<!-- gh-comment-id:2620774595 --> @99991 commented on GitHub (Jan 29, 2025): The line from your first message initializes the member `block.attn.out_proj.weight` of `self.transformer.resblocks` * https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L321 * https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L319 * https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L282 * https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L200 * https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L175 * https://github.com/pytorch/pytorch/blob/3f77002b968c093b2b668fed24d85f6a365d6b3c/torch/nn/modules/activation.py#L1102 But in your last message, you highlight `self.c_proj.weight`, which is not a member of `self.transformer.resblocks`. Instead, it is a member of `AttentionPool2d`, which is only used in `ModifiedResNet`, i.e. `self.visual` of `CLIP`. * https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L85 * https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L58C7-L58C22 * https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L127 * https://github.com/openai/CLIP/blob/dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1/clip/model.py#L264
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#400
No description provided.