sdc17 / UPop

[ICML 2023] UPop: Unified and Progressive Pruning for Compressing Vision-Language Transformers.

Home Page:https://dachuanshi.com/UPop-Project/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

您好,想问一下FLOPs指标的问题

zushiye1 opened this issue · comments

请问,这些模型中的FLOPs指标是如何得到的呢

By fvcore package. See here

UPop/deit/main.py

Lines 343 to 350 in 6aae798

#### Count parameters and FLOPs ####
search_model.eval()
with torch.no_grad():
flop = FlopCountAnalysis(search_model, torch.randn(1, 3, 224, 224).to(device))
print(flop_count_table(flop, max_depth=7, show_param_shapes=True))
print("Total", flop.total() / 1e9)
search_model.train()
#######################################