Skip to content

Instantly share code, notes, and snippets.

@e96031413
Created November 11, 2021 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e96031413/42a1f5ca19d8518c96432a8026861879 to your computer and use it in GitHub Desktop.
Save e96031413/42a1f5ca19d8518c96432a8026861879 to your computer and use it in GitHub Desktop.
# thop(simple)
from thop import profile
model = mobilenetv3_large(width_mult=args.width_mult, num_classes=2)
input = torch.randn(1, 3, 224, 224)
macs, params = profile(model, inputs=(input, ), verbose=False)
print("%.2f | %.2f" % (params / (1000 ** 2), macs / (1000 ** 3)))
# torch info(detailed)
from torchinfo import summary
model = mobilenetv3_large(width_mult=args.width_mult, num_classes=2)
summary(model, input_size=(1, 3, 224, 224))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment