flops-profiler
flops-profiler copied to clipboard
pytorch-profiler
I tried to apply this nice profiler to torchscript models but it failed: ```python Traceback (most recent call last): File "/home/guikarist/projects/test-torch/profiler/test_flops_profile.py", line 48, in flops, macs, params = get_model_profile( File...
I found typo in profiler.py. [line 813] incorrect code: filters_per_channel = out_channels // grofups correct code: filters_per_channel = out_channels // groups
Added a method call to reduce import error. Need to call flops_profiler.profiler instead of flops_profiler
Hello! Thank you for finding my code useful! I have a question though. Does your code also calculate the FLOPS of a Transformer model that you have coded yourself? For...
``` def _wrapFunc(func, funcFlopCompute): global cuda_sync oldFunc = func name = func.__str__ old_functions[name] = oldFunc func_name = func.__name__ def newFunc(*args, **kwds): flops, macs = funcFlopCompute(*args, **kwds) if module_flop_count: module_flop_count[-1].append((name, flops))...
this has code you can run to recreate error. https://github.com/johndpope/MegaPortrait-hack/tree/feat/26-auditflops **return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,** this code is blowing up profiler. is there a way to ignore? file "/media/2TB/MegaPortrait-hack/train.py",...
```python import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader from flops_profiler import FlopsProfiler # Define your model class class Model(nn.Module): def __init__(self): super(Model, self).__init__()...