yitu-opensource / T2T-ViT

ICCV2021, Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet
Other
1.15k stars 177 forks source link

How to calculate MACs? #5

Closed pengzhiliang closed 3 years ago

pengzhiliang commented 3 years ago

Thank u very much! How do you calculate MACs? by using the thop package or other ? and can you release the code?

yuanli2333 commented 3 years ago

Hi, you can calculate the MACs by using thop package, but the results will be lower than the real MACs. We use the script in Google Electra. But this script only compute the FLOPs, which should be 2x of MACs, and you should reset the paramters in this script.

pengzhiliang commented 3 years ago

OK, I'll have a try. Thank u~