Open TongLi97 opened 8 months ago
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. There are new file inside clip directory and some addition in module.py But good result you may get only for old models - for example for ViT-B/32. New models show many noise(( and I don't know why (for now) If you want run notebook with clip examples you have to copy images from current CLIP folder to new patch0.patch
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!
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
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 but an error message appears: AttributeError: 'NoneType' object has no attribute 'shape'
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?