-
Notifications
You must be signed in to change notification settings - Fork 210
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
AttributeError: 'VisionAttention' object has no attribute 'head_dim' #38
Comments
when i set attn_implementation="eager", this error happened. |
@Betty-J thanks for pointing this out, we will fix it. |
5 tasks
we opened a PR for fixing this. |
Has it already fixed ? I meet the same question. |
Simple fix -- just add this line in the VisionAttention class: |
torch版本更新到2.2.2即可 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I am encountering the following error while fine-tuning the qwen2-vl-2b-instruct with the Swift framework:
File "./miniconda3/envs/swift/lib/python3.11/site-packages/transformers/models/qwen2_vl/modeling_qwen2_vl.py", line 296, in forward
[rank1]: attn_weights = torch.matmul(q, k.transpose(1, 2)) / math.sqrt(self.head_dim)
AttributeError: 'VisionAttention' object has no attribute 'head_dim'.
After checking the original modeling_qwen2_vl.py file, I found that 'self.head_dim' is indeed not defined in VisionAttention. How can I resolve it?
The text was updated successfully, but these errors were encountered: