We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having a problem with ptflops 0.7.1 and higher.
I managed to isolate the problem to this sample code:
import torch.nn as nn class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv1d(1, 20, 5) self.conv2 = nn.Conv1d(20, 20, 5) def forward(self, x): y = nn.functional.relu(self.conv1(x)) y = nn.functional.relu(self.conv2(y)) return y from ptflops import get_model_complexity_info model = Model() input_shape = (48000,) get_model_complexity_info(model, input_shape, as_strings=True, print_per_layer_stat=True)
In ptflops 0.7.0 I get 40.52 KMac:
0.7.0
40.52 KMac
Model( 2.14 k, 100.000% Params, 40.52 KMac, 100.000% MACs, (conv1): Conv1d(120, 5.607% Params, 120.0 Mac, 0.296% MACs, 1, 20, kernel_size=(5,), stride=(1,)) (conv2): Conv1d(2.02 k, 94.393% Params, 40.4 KMac, 99.704% MACs, 20, 20, kernel_size=(5,), stride=(1,)) ) Out: ('40.52 KMac', '2.14 k')
In version 7.0.1 and higher I get a value of 1.96 MMac:
7.0.1
1.96 MMac
Model( 2.14 k, 100.000% Params, 40.52 KMac, 2.067% MACs, (conv1): Conv1d(120, 5.607% Params, 120.0 Mac, 0.006% MACs, 1, 20, kernel_size=(5,), stride=(1,)) (conv2): Conv1d(2.02 k, 94.393% Params, 40.4 KMac, 2.061% MACs, 20, 20, kernel_size=(5,), stride=(1,)) ) Out[2]: ('1.96 MMac', '2.14 k')
Where does the large discepancy come from and which value is more reliable?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm having a problem with ptflops 0.7.1 and higher.
I managed to isolate the problem to this sample code:
In ptflops
0.7.0
I get40.52 KMac
:In version
7.0.1
and higher I get a value of1.96 MMac
:Where does the large discepancy come from and which value is more reliable?
The text was updated successfully, but these errors were encountered: