Arnav0400 / ViT-Slim

Official code for our CVPR'22 paper “Vision Transformer Slimming: Multi-Dimension Searching in Continuous Optimization Space”
MIT License
243 stars 17 forks source link

attribute "is_searched" not found because Attention not converted to SparseAttention #12

Open xjaweiofj opened 1 year ago

xjaweiofj commented 1 year ago

As shown in the figure, there are errors reported about the attribute "is_searched" not found. After tracing back this error, I found the problem is because in the class ModuleInjection, it always go to the if condition and return the model without converting the attention layer into SparseAttention. "is_searched" is an attribute only exists in SparseAttention. (For now to solve this problem, I commented out the if branch, but this will bring up new errors.) Is there any solution for this error? Thanks!

image image image

DuZzzs commented 1 year ago

@xjaweiofj hi, same error. Do you know how to fix it?