From 4c22c29004d84a65bfac8cf6d9c008036d5bb9bf Mon Sep 17 00:00:00 2001 From: Vladislav Sovrasov Date: Wed, 17 Jul 2024 09:55:57 +0900 Subject: [PATCH 1/2] Update setup config --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ebef02d..cf011ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta" [project] name = "ptflops" -version = "0.7.3" +version = "0.7.4" dependencies = [ - "torch", + "torch>=2.0", ] -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ {name = "Vladislav Sovrasov", email = "sovrasov.vlad@gmail.com"}, ] @@ -18,10 +18,10 @@ maintainers = [ description = "Flops counter for neural networks in pytorch framework" readme = "README.md" license = {file = "LICENSE"} -keywords = ["pytorch", "cnn", "transformer", "tomatoes", "Lobster Thermidor"] +keywords = ["pytorch", "cnn", "transformer"] classifiers = [ "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3.7" + "Programming Language :: Python :: 3.8" ] [project.optional-dependencies] From abcac0e63bc107c45bb98c35a5a03356c670c665 Mon Sep 17 00:00:00 2001 From: Vladislav Sovrasov Date: Wed, 17 Jul 2024 09:59:14 +0900 Subject: [PATCH 2/2] Update readme --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2e6dcd1..c13a563 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,8 @@ passing `backend_specific_config={"count_functional" : False}`. for research purposes. For instance, one can drop all convolutions from the counting process specifying `ignore_modules=[torch.nn.Conv2d]`. -Requirements: Pytorch >= 1.1, torchvision >= 0.3 - -Thanks to @warmspringwinds and Horace He for the initial version of the script. +## Requirements +Pytorch >= 2.0. Use `pip install ptflops==0.7.2.2` to work with torch 1.x. ## Install the latest version From PyPI: @@ -98,6 +97,10 @@ If ptflops was useful for your paper or tech report, please cite me: } ``` +## Credits + +Thanks to @warmspringwinds and Horace He for the initial version of the script. + ## Benchmark ### [torchvision](https://pytorch.org/vision/0.16/models.html)