https://github.com/sovrasov/flops-counter.pytorch

 

GitHub - sovrasov/flops-counter.pytorch: Flops counter for convolutional networks in pytorch framework

Flops counter for convolutional networks in pytorch framework - GitHub - sovrasov/flops-counter.pytorch: Flops counter for convolutional networks in pytorch framework

github.com

 

 

From PyPI: pip install ptflops

or

From this repository: pip install --upgrade git+https://github.com/sovrasov/flops-counter.pytorch.git

 
    # pth
    eff_model = torchvision.models.efficientnet_b0()

    # Check FLOPS
    macs, params = get_model_complexity_info(eff_model, (3, 224, 224), as_strings=True, print_per_layer_stat=True, verbose=True)
    print('{:<30}   {:<8}'.format('Computational complexity : ', macs))
    print('{:<30}   {:<8}'.format('Number of parameters : ', params))

+ Recent posts