from thop import profile
from thop import clever_format
device = torch.device('cpu')
#大小为自己输入网络的图片大小
input = torch.zeros((1, 3, 224, 224)).to(device)
flops, params = profile(net.to(device), (input,))
flops, params = clever_format([flops, params], "%.3f")
print(flops, params)