-
Notifications
You must be signed in to change notification settings - Fork 107
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
torch.nn.modules.module.ModuleAttributeError: 'ResidualAttentionBlock' object has no attribute 'attn_probs' #39
Comments
have the same problem here |
If you're using the original openai's clip, do use this git repo's clip folder. In their clip/model.py line 184 they defined a new attribute attn_probs that the original clip repo did not have. Hope this helps! |
You may git clone current CLIP (place it instead of CLIP directory inside this module) and patch it with attached patch-file. |
From this-https://github.com/openai/CLIP/blob/main/clip/model.py ? I didn't find the replaced one, can you tell in detail? thanks |
Use this repo’s clip at this link: https://github.com/hila-chefer/Transformer-MM-Explainability/blob/main/CLIP The model file I was mentioning would be here: https://github.com/hila-chefer/Transformer-MM-Explainability/blob/main/CLIP/clip/model.py |
ok thank u! |
I used clip at this link: https://github.com/hila-chefer/Transformer-MM-Explainability/blob/main/CLIP |
Execute line of code:
num_tokens = image_attn_blocks[0].attn_probs.shape[-1]
An error message appears:
torch.nn.modules.module.ModuleAttributeError: 'ResidualAttentionBlock' object has no attribute 'attn_probs'
What problem causes this?
The text was updated successfully, but these errors were encountered: