Skip to content

Commit

Permalink
Ultralytics Refactor https://ultralytics.com/actions (#29)
Browse files Browse the repository at this point in the history
Co-authored-by: UltralyticsAssistant <[email protected]>
  • Loading branch information
glenn-jocher and UltralyticsAssistant committed Jun 20, 2024
1 parent 9517cac commit 9da0229
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<br>
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320">
<a href="https://ultralytics.com" target="_blank"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>

# 🚀 THOP: PyTorch-OpCounter

Expand Down Expand Up @@ -34,9 +34,10 @@ pip install --upgrade git+https://github.com/ultralytics/thop.git
To profile a model, you can use the following example:

```python
import torch
from torchvision.models import resnet50

from thop import profile
import torch

model = resnet50()
input = torch.randn(1, 3, 224, 224)
Expand Down Expand Up @@ -154,7 +155,7 @@ For bugs or feature requests, please open an issue on [GitHub Issues](https://gi
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="3%" alt="Ultralytics Instagram"></a>
<a href="https://ultralytics.com/bilibili"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-bilibili.png" width="3%" alt="Ultralytics Instagram"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
</div>
2 changes: 1 addition & 1 deletion thop/vision/basic_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def zero_ops(m, x, y):
def count_convNd(m: _ConvNd, x, y: torch.Tensor):
"""Calculate and add the number of convolutional operations (FLOPs) to the model's total operations count."""
x = x[0]

m.total_ops += calculate_conv2d_flops(
input_size=list(x.shape),
output_size=list(y.shape),
Expand Down

0 comments on commit 9da0229

Please sign in to comment.