Comments (5)
I think you suggestion is correct. In total there are H_out * W_out * out_channels pixels and each pixel takes ** in_channels * (kernel_size * kernel_size - 1) ** operations.
For MACs and FLOPs, it is not simple 2 times calculation. In short, it depends how you count the multiplication for floating numbers. I will refactor the codebase to fix the issue.
from pytorch-opcounter.
Thank you! Will you please let me know as soon as you fixed the code, so that I can update the python package?
from pytorch-opcounter.
After talking to an expert in hardware, I made a clarification of MACs and FLOPs. For AVGPooling, the updated MAC should be H_out * W_out * out_channels. If you agree with it, I will update the corresponding code recently.
from pytorch-opcounter.
@fortunex3000 any comments?
from pytorch-opcounter.
After talking to an expert in hardware, I made a clarification of MACs and FLOPs. For AVGPooling, the updated MAC should be H_out * W_out * out_channels. If you agree with it, I will update the corresponding code recently.
But if you do this, it is different from the statistical method of TensorFlow and the userβs conventional perception
from pytorch-opcounter.
Related Issues (20)
- question about the MACs of nn.BatchNorm2d
- got 0 ops for nn.MultiheadAttention HOT 7
- Count flops by a range
- thop/profile.py:12: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. `if LooseVersion(torch.__version__) < LooseVersion("1.0.0"):` HOT 2
- Does MACs and FLOPs count correctly for and INT8 quantized model? HOT 1
- Upload sdist to PyPI HOT 1
- Problem in bert HOT 1
- multiple inputs HOT 1
- Is the latest version calculate MACs or FLOPs HOT 2
- RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
- How to calculate the FLOPs of each type of layers?
- How to exclude flops of 1st input? HOT 1
- Incorrect macs without specifying batch size for conv layers
- will torch.matmul regards as zero_ops ?
- Is thop also effective for calculating Flops for spiking neural networks?
- rename calculate_conv2d_flops HOT 1
- thop calculates torch.nn module params incorrectly HOT 1
- RuntimeError: Can't add a new parameter
- count_normalization is only correct for batch_norm. wrong flops count for layernorm HOT 1
- Res add will be included when evaluate Resnet's OPs ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-opcounter.