计算FLOPs相关
aoaforever opened this issue · 1 comments
aoaforever commented
您好!我有两个问题需要请教:
- 请问代码里为什么需要除以sum(num_ress) ?
- 为什么对FRCNN网络的flops还需要加上7.4 ?
期待您的解答,谢谢!!
def cal_FLOPs(which_model,num_ress):
if which_model =='classSR_3class_fsrcnn_net':
flops = ((141 * num_ress[0] + 304 * num_ress[1] + 468 * num_ress[2]) / sum(num_ress))+7.4
percent=flops/468
elif which_model=='classSR_3class_carn':
flops = (0.38 * num_ress[0] + 0.77 * num_ress[1] + 1.15 * num_ress[2]) / sum(num_ress)
percent = flops / 1.15
elif which_model=='classSR_3class_srresnet':
flops = (1.66 * num_ress[0] + 3.44 * num_ress[1] + 5.20 * num_ress[2]) / sum(num_ress)
percent = flops / 5.20
elif which_model=='classSR_3class_rcan':
flops = (10.33 * num_ress[0] + 19.90 * num_ress[1] + 32.60 * num_ress[2]) / sum(num_ress)
percent = flops / 32.60
return flops,percent
Xiangtaokong commented
1.除总patch数目,算平均的flops
2.加的是分类器的计算量。后面几个模型比分类器大太多,基本算着没影响,就没加
…---原始邮件---
发件人: ***@***.***>
发送时间: 2022年10月17日(周一) 晚上9:54
收件人: ***@***.***>;
抄送: ***@***.***>;
主题: [XPixelGroup/ClassSR] 计算FLOPs相关 (Issue #50)
您好!我有两个问题需要请教:
请问代码里为什么需要除以sum(num_ress) ?
为什么对FRCNN网络的flops还需要加上7.4 ?
期待您的解答,谢谢!!
def cal_FLOPs(which_model,num_ress): if which_model =='classSR_3class_fsrcnn_net': flops = ((141 * num_ress[0] + 304 * num_ress[1] + 468 * num_ress[2]) / sum(num_ress))+7.4 percent=flops/468 elif which_model=='classSR_3class_carn': flops = (0.38 * num_ress[0] + 0.77 * num_ress[1] + 1.15 * num_ress[2]) / sum(num_ress) percent = flops / 1.15 elif which_model=='classSR_3class_srresnet': flops = (1.66 * num_ress[0] + 3.44 * num_ress[1] + 5.20 * num_ress[2]) / sum(num_ress) percent = flops / 5.20 elif which_model=='classSR_3class_rcan': flops = (10.33 * num_ress[0] + 19.90 * num_ress[1] + 32.60 * num_ress[2]) / sum(num_ress) percent = flops / 32.60 return flops,percent
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>