Yolo-FastestV2
Yolo-FastestV2 copied to clipboard
FLOPS
大佬想问一下,FLOPS怎么知道的
谷歌一下,网上都能查到,一个是自己计算,一个是所用的神经网络框架自己计算得到
you can get the flops of you model as follows:
from ptflops import get_model_complexity_info
h, w = (192, 192)
with torch.cuda.device(0):
macs, params = get_model_complexity_info(
model, (3, h, w),
as_strings=True, print_per_layer_stat=True, verbose=True
)
flops = str(float(macs.split(' ')[0]) * 2) + " GFLOPs"
print('{:<30} {:<8}'.format('Computational complexity: ', macs))
print('{:<30} {:<8}'.format('FLOPs: ', flops))
print('{:<30} {:<8}'.format('Number of parameters: ', params))