赞
踩
参考链接:https://blog.csdn.net/tsq292978891/article/details/87918244
打印模型参数信息
在python3环境下安装torchsummary
from torchsummary import summary
import torchvision.models as models
model = models.resnet152()
model = model.cuda()
summary(model, input_size=(3,224,224), batch_size=-1, device='cuda')
计算模型FLOPs
代码详见:https://github.com/TangShengqin/pytorch_learn/blob/master/model_flops.py
其中,multiply_adds = True会同时累计加法和乘法的计算量。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。