sovrasov / flops-counter.pytorch

Flops counter for convolutional networks in pytorch framework
MIT License
2.82k stars 307 forks source link

failed to install #131

Closed yongshangli closed 4 months ago

yongshangli commented 10 months ago

Collecting ptflops Using cached ptflops-0.7.2.1.tar.gz (14 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: torch in d:\app\miniconda3\envs\mmseg\lib\site-packages (from ptflops) (2.1.2) Requirement already satisfied: filelock in d:\app\miniconda3\envs\mmseg\lib\site-packages (from torch->ptflops) (3.13.1) Requirement already satisfied: typing-extensions in d:\app\miniconda3\envs\mmseg\lib\site-packages (from torch->ptflops) (4.9.0) Requirement already satisfied: sympy in d:\app\miniconda3\envs\mmseg\lib\site-packages (from torch->ptflops) (1.12) Requirement already satisfied: networkx in d:\app\miniconda3\envs\mmseg\lib\site-packages (from torch->ptflops) (3.1) Requirement already satisfied: jinja2 in d:\app\miniconda3\envs\mmseg\lib\site-packages (from torch->ptflops) (3.1.2) Collecting fsspec (from torch->ptflops) Using cached fsspec-2023.12.2-py3-none-any.whl.metadata (6.8 kB) Requirement already satisfied: MarkupSafe>=2.0 in d:\app\miniconda3\envs\mmseg\lib\site-packages (from jinja2->torch->ptflops) (2.1.3) Requirement already satisfied: mpmath>=0.19 in d:\app\miniconda3\envs\mmseg\lib\site-packages (from sympy->torch->ptflops) (1.3.0) Using cached fsspec-2023.12.2-py3-none-any.whl (168 kB) Building wheels for collected packages: ptflops Building wheel for ptflops (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [100 lines of output] running bdist_wheel running build running build_py creating build creating build\lib creating build\lib\ptflops copying C:\Users\yongs\AppData\Local\Temp\pip-install-918vnlpx\ptflops_2db49442faef4833af92f4dda674e13d\ptflops\flops_counter.py -> build\lib\ptflops copying C:\Users\yongs\AppData\Local\Temp\pip-install-918vnlpx\ptflops_2db49442faef4833af92f4dda674e13d\ptflops\pytorch_engine.py -> build\lib\ptflops copying C:\Users\yongs\AppData\Local\Temp\pip-install-918vnlpx\ptflops_2db49442faef4833af92f4dda674e13d\ptflops\pytorch_ops.py -> build\lib\ptflops copying C:\Users\yongs\AppData\Local\Temp\pip-install-918vnlpx\ptflops_2db49442faef4833af92f4dda674e13d\ptflops\utils.py -> build\lib\ptflops copying C:\Users\yongs\AppData\Local\Temp\pip-install-918vnlpx\ptflops_2db49442faef4833af92f4dda674e13d\ptflops__init__.py -> build\lib\ptflops D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!

          ********************************************************************************
          Please avoid running ``setup.py`` directly.
          Instead, use pypa/build, pypa/installer or other
          standards-based tools.

          See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
          ********************************************************************************

  !!
    self.initialize_options()
  installing to build\bdist.win-amd64\wheel
  running install
  running install_lib
  creating build\bdist.win-amd64
  creating build\bdist.win-amd64\wheel
  creating build\bdist.win-amd64\wheel\ptflops
  copying build\lib\ptflops\flops_counter.py -> build\bdist.win-amd64\wheel\.\ptflops
  copying build\lib\ptflops\pytorch_engine.py -> build\bdist.win-amd64\wheel\.\ptflops
  copying build\lib\ptflops\pytorch_ops.py -> build\bdist.win-amd64\wheel\.\ptflops
  copying build\lib\ptflops\utils.py -> build\bdist.win-amd64\wheel\.\ptflops
  copying build\lib\ptflops\__init__.py -> build\bdist.win-amd64\wheel\.\ptflops
  running install_egg_info
  running egg_info
  writing ptflops.egg-info\PKG-INFO
  writing dependency_links to ptflops.egg-info\dependency_links.txt
  writing requirements to ptflops.egg-info\requires.txt
  writing top-level names to ptflops.egg-info\top_level.txt
  reading manifest file 'ptflops.egg-info\SOURCES.txt'
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\yongs\AppData\Local\Temp\pip-install-918vnlpx\ptflops_2db49442faef4833af92f4dda674e13d\setup.py", line 30, in <module>
      setup(
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\wheel\bdist_wheel.py", line 399, in run
      self.run_command("install")
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\command\install.py", line 78, in run
      return orig.install.run(self)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\command\install.py", line 708, in run
      self.run_command(cmd_name)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\command\install_egg_info.py", line 31, in run
      self.run_command('egg_info')
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\command\egg_info.py", line 318, in run
      self.find_sources()
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\command\egg_info.py", line 326, in find_sources
      mm.run()
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\command\egg_info.py", line 548, in run
      self.add_defaults()
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\command\egg_info.py", line 593, in add_defaults
      self.read_manifest()
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\command\sdist.py", line 214, in read_manifest
      self.filelist.append(line)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\command\egg_info.py", line 485, in append
      path = convert_path(item)
    File "D:\App\miniconda3\envs\mmseg\lib\site-packages\setuptools\_distutils\util.py", line 139, in convert_path
      raise ValueError("path '%s' cannot be absolute" % pathname)
  ValueError: path '/home/vsovraso/code/flops-counter.pytorch/ptflops/__init__.py' cannot be absolute
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for ptflops Running setup.py clean for ptflops Failed to build ptflops ERROR: Could not build wheels for ptflops, which is required to install pyproject.toml-based projects

I'm sorry, but I got this problem. win11, python3.10, torch2.1, torchvision0.16

synml commented 10 months ago

I also have the same error with pip install ptflops. Use pip install --upgrade git+https://github.com/sovrasov/flops-counter.pytorch.git.

sovrasov commented 9 months ago

@yongshangli @synml please check the latest package version (0.7.2.2)