'How to calculate FLOPs of a given model (.pth file)?

I am using a faster rcnn model for object detection. I was wondering if there is any spefcific way/program to calculate FLOPs of a model based on the config or trained model file( machine learning model using PyTorch,.pth file).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source