当前位置:网站首页>How to calculate flops and params in deep learning

How to calculate flops and params in deep learning

2022-06-26 11:14:00 Captain Flying Tiger Brigade

Just as a record , Big man, please skip .

When model After reading , Use :

from thop import profile

dummy_input = torch.randn(1, 3, 224, 224)
flops, params = profile(model, (dummy_input,))
print('flops: ', flops, 'params: ', params)
print('flops: %.2f M, params: %.2f M' % (flops / 1000000.0, params / 1000000.0))

that will do .

Such as resnet-101 Of :

 Insert picture description here
Reference resources

Portal

原网站

版权声明
本文为[Captain Flying Tiger Brigade]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261020020837.html