Skip to content
New issue

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

Ultralytics Code Refactor https://ultralytics.com/actions #29

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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