【FLOPS】各种模型统计FLOPs

简介:

FLOPs : FLOATING-POINT OPERATIONS PER SECOND

1、Pytorch:

pytorch有PyTorch-OpCounter:

github: https://github.com/Lyken17/pytorch-OpCounter

安装:pip install thop

from torchvision.models import resnet18
from thop import profile
import torch

model = resnet18()
input = torch.randn(1, 3, 224, 224)
flops, params = profile(model, inputs=(input, ))

print(flops)

 

你可能感兴趣的:(深度学习)