IDEA-Research / Grounded-Segment-Anything

Grounded SAM: Marrying Grounding DINO with Segment Anything & Stable Diffusion & Recognize Anything - Automatically Detect , Segment and Generate Anything

Home Page:https://arxiv.org/abs/2401.14159

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install fails at last step "Install RAM & Tag2Text"

jferments opened this issue · comments

I am following install instructions, and am at last step "Install RAM & Tag2Text":

git clone https://github.com/xinyu1205/recognize-anything.git
pip install -r ./recognize-anything/requirements.txt
pip install -e ./recognize-anything/

And when I do this, I encounter the following error:

Successfully installed clip-1.0 fairscale-0.4.4 ftfy-6.2.0 pycocoevalcap-1.2 timm-0.4.12 tokenizers-0.13.3 transformers-4.25.1 wcwidth-0.2.13
DEPRECATION: Loading egg at /home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/mmpose-0.28.0-py3.11.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
DEPRECATION: Loading egg at /home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/xtcocotools-1.14.3-py3.11-linux-x86_64.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
DEPRECATION: Loading egg at /home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/munkres-1.1.4-py3.11.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
Obtaining file:///home/jesse/code/grounded-sam/Grounded-Segment-Anything/recognize-anything
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      Traceback (most recent call last):
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 102, in __init__
          req = REQUIREMENT.parseString(requirement_string)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/pkg_resources/_vendor/pyparsing.py", line 1654, in parseString
          raise exc
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/pkg_resources/_vendor/pyparsing.py", line 1644, in parseString
          loc, tokens = self._parse( instring, 0 )
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/pkg_resources/_vendor/pyparsing.py", line 1402, in _parseNoCache
          loc,tokens = self.parseImpl( instring, preloc, doActions )
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/pkg_resources/_vendor/pyparsing.py", line 3417, in parseImpl
          loc, exprtokens = e._parse( instring, loc, doActions )
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/pkg_resources/_vendor/pyparsing.py", line 1406, in _parseNoCache
          loc,tokens = self.parseImpl( instring, preloc, doActions )
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/pkg_resources/_vendor/pyparsing.py", line 3205, in parseImpl
          raise ParseException(instring, loc, self.errmsg, self)
      pkg_resources._vendor.pyparsing.ParseException: Expected stringEnd (at char 4), (line:1, col:5)
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/home/jesse/code/grounded-sam/Grounded-Segment-Anything/recognize-anything/setup.py", line 2, in <module>
          setuptools.setup()
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/setuptools/__init__.py", line 154, in setup
          _install_setup_requires(attrs)
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/setuptools/__init__.py", line 146, in _install_setup_requires
          dist.parse_config_files(ignore_option_errors=True)
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/setuptools/dist.py", line 807, in parse_config_files
          self._finalize_requires()
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/setuptools/dist.py", line 534, in _finalize_requires
          self._move_install_requirements_markers()
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/setuptools/dist.py", line 573, in _move_install_requirements_markers
          inst_reqs = list(pkg_resources.parse_requirements(spec_inst_reqs))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3099, in parse_requirements
          yield Requirement(line)
                ^^^^^^^^^^^^^^^^^
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3109, in __init__
          super(Requirement, self).__init__(requirement_string)
        File "/home/jesse/code/grounded-sam/gsam-venv/lib/python3.11/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 104, in __init__
          raise InvalidRequirement(
      pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "': requir'": Expected stringEnd
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

Any idea how to proceed?

Maybe you can follow recognize-anything official installation guide to install it~

same issue here and it doesn't work to use the instructions on recognize anything github repo to install either

after retrying with a new env and everything it worked. no idea why because i think im using same python version and everything

setuptools>=62.6.0 is required.

commented

pip install --upgrade setuptools