Pytorch模型flops, params計算

thop

import thop
from torchvision.models import resnet50

if __name__ == "__main__":

    model = resnet50()
    input = torch.randn(1, 3, 224, 224)
    flops, params = thop.profile(model, inputs=(input, ))
    flops, params = thop.clever_format([flops, params], "%.3f")  # 提升結果可讀性
    

Naive

1

1

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章