IDEA-Research / Grounded-Segment-Anything

Grounded SAM: Marrying Grounding DINO with Segment Anything & Stable Diffusion & Recognize Anything - Automatically Detect , Segment and Generate Anything
https://arxiv.org/abs/2401.14159
Apache License 2.0
15.16k stars 1.4k forks source link

ERROR: Could not build wheels for groundingdino, which is required to install pyproject.toml-based projects #242

Open daizhuo opened 1 year ago

daizhuo commented 1 year ago

我折腾了几天,还特别去安装了: pyproj-3.2.1-cp310-cp310-win_amd64.whl

还是提示这个: ERROR: Could not build wheels for groundingdino, which is required to install pyproject.toml-based projects

我不会编写程序,只是想用这个功能,如果可能请详细一些解说下问题,非常感谢!

rentainhe commented 1 year ago

您好,可以将完整的报错发给我们看一下吗,如果需要在Windows上配置这样的环境,需要安装C++14.0,以及pycocotools的Windows版本,这个过程可能会有一些小小的麻烦,您愿意分享一下完整的报错信息吗,我们这边会帮忙看看,但是不确定能100%解决,因为我们目前还没有windows上好的测试环境,我们会尽力帮您看 @daizhuo

daizhuo commented 1 year ago

哗!感谢大佬!膜拜+叩头! 我其实是一个建筑师,发现你们搞的这成果对建筑表现有非常大的作用,感谢! 我是装了 https://github.com/continue-revolution/sd-webui-segment-anything 这个插件,然后想用到您们开发的这个超劲工具,但是尝试了好几天,还是失败了。 能装的我都装上,包括visual studio 2022,以及pycocotools(pyproj-3.2.1-cp310-cp310-win_amd64.whl) 我运行的平台是 windows 10 stable diffusion 用的是 AUTOMATIC1111 的 Stable diffusion WEBUI v1.10 (https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#ignore-last-layers-of-clip-model

安装过程CMD显示如下:

Installing sd-webui-segment-anything requirement: groundingdino████████████████████████| 20/20 [00:08<00:00, 2.52it/s] Traceback (most recent call last): File "D:\AI\stable-diffusion-webui-1.1.0\extensions\sd-webui-segment-anything\scripts\dino.py", line 36, in install_goundingdino launch.run_pip( File "D:\AI\stable-diffusion-webui-1.1.0\launch.py", line 128, in run_pip return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live) File "D:\AI\stable-diffusion-webui-1.1.0\launch.py", line 96, in run raise RuntimeError(message) RuntimeError: Couldn't install sd-webui-segment-anything requirement: groundingdino. Command: "D:\AI\stable-diffusion-webui-1.1.0\venv\Scripts\python.exe" -m pip install git+https://github.com/IDEA-Research/GroundingDINO --prefer-binary Error code: 1 stdout: Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting git+https://github.com/IDEA-Research/GroundingDINO Cloning https://github.com/IDEA-Research/GroundingDINO to c:\users\pc\appdata\local\temp\pip-req-build-_41amj7r Resolved https://github.com/IDEA-Research/GroundingDINO to commit 654f5e8bf97dce87da7e84e0d3feeb5bbad95388 Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: torch in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (2.0.0+cu118) Requirement already satisfied: torchvision in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (0.15.1+cu118) Requirement already satisfied: transformers in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (4.25.1) Requirement already satisfied: addict in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (2.4.0) Requirement already satisfied: yapf in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (0.33.0) Requirement already satisfied: timm in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (0.6.7) Requirement already satisfied: numpy in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (1.23.5) Requirement already satisfied: opencv-python in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (4.7.0.72) Requirement already satisfied: supervision==0.6.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (0.6.0) Requirement already satisfied: pycocotools in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (2.0.6) Requirement already satisfied: matplotlib in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from supervision==0.6.0->groundingdino==0.1.0) (3.7.1) Requirement already satisfied: filelock in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torch->groundingdino==0.1.0) (3.12.0) Requirement already satisfied: typing-extensions in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torch->groundingdino==0.1.0) (4.5.0) Requirement already satisfied: sympy in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torch->groundingdino==0.1.0) (1.11.1) Requirement already satisfied: networkx in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torch->groundingdino==0.1.0) (3.1) Requirement already satisfied: jinja2 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torch->groundingdino==0.1.0) (3.1.2) Requirement already satisfied: requests in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torchvision->groundingdino==0.1.0) (2.25.1) Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torchvision->groundingdino==0.1.0) (9.4.0) Requirement already satisfied: huggingface-hub<1.0,>=0.10.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (0.14.1) Requirement already satisfied: packaging>=20.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (23.1) Requirement already satisfied: pyyaml>=5.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (6.0) Requirement already satisfied: regex!=2019.12.17 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (2023.5.5) Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (0.13.3) Requirement already satisfied: tqdm>=4.27 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (4.65.0) Requirement already satisfied: tomli>=2.0.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from yapf->groundingdino==0.1.0) (2.0.1) Requirement already satisfied: fsspec in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from huggingface-hub<1.0,>=0.10.0->transformers->groundingdino==0.1.0) (2023.5.0) Requirement already satisfied: contourpy>=1.0.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (1.0.7) Requirement already satisfied: cycler>=0.10 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (0.11.0) Requirement already satisfied: fonttools>=4.22.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (4.39.3) Requirement already satisfied: kiwisolver>=1.0.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (1.4.4) Requirement already satisfied: pyparsing>=2.3.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (3.0.9) Requirement already satisfied: python-dateutil>=2.7 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (2.8.2) Requirement already satisfied: colorama in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from tqdm>=4.27->transformers->groundingdino==0.1.0) (0.4.6) Requirement already satisfied: MarkupSafe>=2.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from jinja2->torch->groundingdino==0.1.0) (2.1.2) Requirement already satisfied: chardet<5,>=3.0.2 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (4.0.0) Requirement already satisfied: idna<3,>=2.5 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (2.10) Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (1.26.15) Requirement already satisfied: certifi>=2017.4.17 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (2023.5.7) Requirement already satisfied: mpmath>=0.19 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from sympy->torch->groundingdino==0.1.0) (1.3.0) Requirement already satisfied: six>=1.5 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from python-dateutil>=2.7->matplotlib->supervision==0.6.0->groundingdino==0.1.0) (1.16.0) Building wheels for collected packages: groundingdino Building wheel for groundingdino (setup.py): started Building wheel for groundingdino (setup.py): finished with status 'error' Running setup.py clean for groundingdino Failed to build groundingdino

stderr: Running command git clone --filter=blob:none --quiet https://github.com/IDEA-Research/GroundingDINO 'C:\Users\PC\AppData\Local\Temp\pip-req-build-_41amj7r' error: subprocess-exited-with-error

python setup.py bdist_wheel did not run successfully. exit code: 1

[53 lines of output] Building wheel groundingdino-0.1.0 Compiling with CUDA running bdist_wheel D:\AI\stable-diffusion-webui-1.1.0\venv\lib\site-packages\torch\utils\cpp_extension.py:476: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) running build running build_py creating build creating build\lib.win-amd64-cpython-310 creating build\lib.win-amd64-cpython-310\groundingdino copying groundingdino\version.py -> build\lib.win-amd64-cpython-310\groundingdino copying groundingdino__init.py -> build\lib.win-amd64-cpython-310\groundingdino creating build\lib.win-amd64-cpython-310\groundingdino\config copying groundingdino\config\GroundingDINO_SwinB_cfg.py -> build\lib.win-amd64-cpython-310\groundingdino\config copying groundingdino\config\GroundingDINO_SwinT_OGC.py -> build\lib.win-amd64-cpython-310\groundingdino\config copying groundingdino\config\init.py -> build\lib.win-amd64-cpython-310\groundingdino\config creating build\lib.win-amd64-cpython-310\groundingdino\datasets copying groundingdino\datasets\transforms.py -> build\lib.win-amd64-cpython-310\groundingdino\datasets copying groundingdino\datasets\init.py -> build\lib.win-amd64-cpython-310\groundingdino\datasets creating build\lib.win-amd64-cpython-310\groundingdino\models copying groundingdino\models\registry.py -> build\lib.win-amd64-cpython-310\groundingdino\models copying groundingdino\models\init.py -> build\lib.win-amd64-cpython-310\groundingdino\models creating build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\box_ops.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\get_tokenlizer.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\inference.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\logger.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\misc.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\slconfig.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\slio.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\time_counter.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\utils.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\visualizer.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\vl_utils.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\init.py -> build\lib.win-amd64-cpython-310\groundingdino\util creating build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\bertwarper.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\fuse_modules.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\groundingdino.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\ms_deform_attn.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\transformer.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\transformer_vanilla.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\utils.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\init.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO creating build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO\backbone copying groundingdino\models\GroundingDINO\backbone\backbone.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO\backbone copying groundingdino\models\GroundingDINO\backbone\position_encoding.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO\backbone copying groundingdino\models\GroundingDINO\backbone\swin_transformer.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO\backbone copying groundingdino\models\GroundingDINO\backbone\init__.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO\backbone running build_ext D:\AI\stable-diffusion-webui-1.1.0\venv\lib\site-packages\torch\utils\cpp_extension.py:359: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified warnings.warn(f'Error checking compiler version for {compiler}: {error}') error: [WinError 2] The system cannot find the file specified [end of output]

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

None GroundingDINO install failed. Please submit an issue to https://github.com/IDEA-Research/Grounded-Segment-Anything/issues.

chunming1022 commented 1 year ago

我也有这个错误,困惑几天了,解决好了务必T我 o(╥﹏╥)o

daizhuo commented 1 year ago

我也有这个错误,困惑几天了,解决好了务必T我 o(╥﹏╥)o

我可能发现了问题所在。我有两台机,一台机是用 RTX2080 SUPER 8G,CUDA 11.6 安装和运行GROUNDDINO都没问题;但另一台是 RTX3060 12G, 只能装 CUDA 12.1, 安装不了GROUNDDINO。应该是要用老版的 CUDA才行,但这台机不知道为什么就是装不上.......

不知道是否真是这样,希望有人可能解答到,谢谢!

daizhuo commented 1 year ago

您好,可以将完整的报错发给我们看一下吗,如果需要在Windows上配置这样的环境,需要安装C++14.0,以及pycocotools的Windows版本,这个过程可能会有一些小小的麻烦,您愿意分享一下完整的报错信息吗,我们这边会帮忙看看,但是不确定能100%解决,因为我们目前还没有windows上好的测试环境,我们会尽力帮您看 @daizhuo

请问是否不支持 CUDA 12.1 ?

amimi818 commented 1 year ago

我也遇到了同样的问题,几经周折,总算解决了:

  1. 开始启用groundingdino(自行安装)时,报:The detected CUDA version (12.1) mismatches the version that was used to compile PyTorch (11.8)... 我安装了最新的cuda(12.1),虽然webui可以正常运行,但安装groundingdino不行,显然groundingdino是不能在cuda12.1环境下运行。
  2. 卸载了cuda(12.1),重新启动webui(仍然可以正常运行,webui应该是把一些cuda的库文件拷到自己的虚拟环境下了,所以不依赖我原来安装的系统cuda);
  3. 启用groundingdino(自行安装),不报cuda不匹配错误了,但出现了和楼主一样的错误:RROR: Could not build wheels for groundingdino, which is required to install pyproject.toml-based projects
  4. 按照new bing的指导,重新安装更新了wheel(pip install --upgrade pip setuptools wheel;python3 -m pip install python-dev-tools --user --upgrade),还是报同样错误;
  5. 下载并重新安装了cuda11.8([https://developer.nvidia.com/cuda-11-8-0-download-archive),重启web UI,启用groundingdino,谢天谢地,终于安装成功并能正常运行了!!!

希望对你们能有帮助。@chunming1022 @daizhuo

daizhuo commented 1 year ago

感谢楼上,我终于能降级安装CUDA 11.8了,但仍然报错,如下:

Start SAM Processing Installing sd-webui-segment-anything requirement: groundingdino Traceback (most recent call last): File "D:\AI\stable-diffusion-webui-1.1.0\extensions\sd-webui-segment-anything\scripts\dino.py", line 36, in install_goundingdino launch.run_pip( File "D:\AI\stable-diffusion-webui-1.1.0\launch.py", line 128, in run_pip return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live) File "D:\AI\stable-diffusion-webui-1.1.0\launch.py", line 96, in run raise RuntimeError(message) RuntimeError: Couldn't install sd-webui-segment-anything requirement: groundingdino. Command: "D:\AI\stable-diffusion-webui-1.1.0\venv\Scripts\python.exe" -m pip install git+https://github.com/IDEA-Research/GroundingDINO --prefer-binary Error code: 1 stdout: Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting git+https://github.com/IDEA-Research/GroundingDINO Cloning https://github.com/IDEA-Research/GroundingDINO to c:\users\pc\appdata\local\temp\pip-req-build-ly0skz5b Resolved https://github.com/IDEA-Research/GroundingDINO to commit 654f5e8bf97dce87da7e84e0d3feeb5bbad95388 Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: torch in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (2.0.0+cu118) Requirement already satisfied: torchvision in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (0.15.1+cu118) Requirement already satisfied: transformers in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (4.25.1) Requirement already satisfied: addict in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (2.4.0) Requirement already satisfied: yapf in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (0.33.0) Requirement already satisfied: timm in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (0.6.7) Requirement already satisfied: numpy in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (1.23.5) Requirement already satisfied: opencv-python in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (4.7.0.72) Requirement already satisfied: supervision==0.6.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (0.6.0) Requirement already satisfied: pycocotools in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from groundingdino==0.1.0) (2.0.6) Requirement already satisfied: matplotlib in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from supervision==0.6.0->groundingdino==0.1.0) (3.7.1) Requirement already satisfied: filelock in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torch->groundingdino==0.1.0) (3.12.0) Requirement already satisfied: typing-extensions in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torch->groundingdino==0.1.0) (4.5.0) Requirement already satisfied: sympy in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torch->groundingdino==0.1.0) (1.11.1) Requirement already satisfied: networkx in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torch->groundingdino==0.1.0) (3.1) Requirement already satisfied: jinja2 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torch->groundingdino==0.1.0) (3.1.2) Requirement already satisfied: requests in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torchvision->groundingdino==0.1.0) (2.25.1) Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from torchvision->groundingdino==0.1.0) (9.4.0) Requirement already satisfied: huggingface-hub<1.0,>=0.10.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (0.14.1) Requirement already satisfied: packaging>=20.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (23.1) Requirement already satisfied: pyyaml>=5.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (6.0) Requirement already satisfied: regex!=2019.12.17 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (2023.5.5) Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (0.13.3) Requirement already satisfied: tqdm>=4.27 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (4.65.0) Requirement already satisfied: tomli>=2.0.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from yapf->groundingdino==0.1.0) (2.0.1) Requirement already satisfied: fsspec in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from huggingface-hub<1.0,>=0.10.0->transformers->groundingdino==0.1.0) (2023.5.0) Requirement already satisfied: contourpy>=1.0.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (1.0.7) Requirement already satisfied: cycler>=0.10 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (0.11.0) Requirement already satisfied: fonttools>=4.22.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (4.39.3) Requirement already satisfied: kiwisolver>=1.0.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (1.4.4) Requirement already satisfied: pyparsing>=2.3.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (3.0.9) Requirement already satisfied: python-dateutil>=2.7 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from matplotlib->supervision==0.6.0->groundingdino==0.1.0) (2.8.2) Requirement already satisfied: colorama in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from tqdm>=4.27->transformers->groundingdino==0.1.0) (0.4.6) Requirement already satisfied: MarkupSafe>=2.0 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from jinja2->torch->groundingdino==0.1.0) (2.1.2) Requirement already satisfied: chardet<5,>=3.0.2 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (4.0.0) Requirement already satisfied: idna<3,>=2.5 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (2.10) Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (1.26.15) Requirement already satisfied: certifi>=2017.4.17 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (2023.5.7) Requirement already satisfied: mpmath>=0.19 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from sympy->torch->groundingdino==0.1.0) (1.3.0) Requirement already satisfied: six>=1.5 in d:\ai\stable-diffusion-webui-1.1.0\venv\lib\site-packages (from python-dateutil>=2.7->matplotlib->supervision==0.6.0->groundingdino==0.1.0) (1.16.0) Building wheels for collected packages: groundingdino Building wheel for groundingdino (setup.py): started Building wheel for groundingdino (setup.py): finished with status 'error' Running setup.py clean for groundingdino Failed to build groundingdino

stderr: Running command git clone --filter=blob:none --quiet https://github.com/IDEA-Research/GroundingDINO 'C:\Users\PC\AppData\Local\Temp\pip-req-build-ly0skz5b' error: subprocess-exited-with-error

python setup.py bdist_wheel did not run successfully. exit code: 1

[70 lines of output] Building wheel groundingdino-0.1.0 Compiling with CUDA running bdist_wheel D:\AI\stable-diffusion-webui-1.1.0\venv\lib\site-packages\torch\utils\cpp_extension.py:476: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) running build running build_py creating build creating build\lib.win-amd64-cpython-310 creating build\lib.win-amd64-cpython-310\groundingdino copying groundingdino\version.py -> build\lib.win-amd64-cpython-310\groundingdino copying groundingdino__init.py -> build\lib.win-amd64-cpython-310\groundingdino creating build\lib.win-amd64-cpython-310\groundingdino\config copying groundingdino\config\GroundingDINO_SwinB_cfg.py -> build\lib.win-amd64-cpython-310\groundingdino\config copying groundingdino\config\GroundingDINO_SwinT_OGC.py -> build\lib.win-amd64-cpython-310\groundingdino\config copying groundingdino\config\init.py -> build\lib.win-amd64-cpython-310\groundingdino\config creating build\lib.win-amd64-cpython-310\groundingdino\datasets copying groundingdino\datasets\transforms.py -> build\lib.win-amd64-cpython-310\groundingdino\datasets copying groundingdino\datasets\init.py -> build\lib.win-amd64-cpython-310\groundingdino\datasets creating build\lib.win-amd64-cpython-310\groundingdino\models copying groundingdino\models\registry.py -> build\lib.win-amd64-cpython-310\groundingdino\models copying groundingdino\models\init.py -> build\lib.win-amd64-cpython-310\groundingdino\models creating build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\box_ops.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\get_tokenlizer.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\inference.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\logger.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\misc.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\slconfig.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\slio.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\time_counter.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\utils.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\visualizer.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\vl_utils.py -> build\lib.win-amd64-cpython-310\groundingdino\util copying groundingdino\util\init.py -> build\lib.win-amd64-cpython-310\groundingdino\util creating build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\bertwarper.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\fuse_modules.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\groundingdino.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\ms_deform_attn.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\transformer.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\transformer_vanilla.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\utils.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO copying groundingdino\models\GroundingDINO\init.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO creating build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO\backbone copying groundingdino\models\GroundingDINO\backbone\backbone.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO\backbone copying groundingdino\models\GroundingDINO\backbone\position_encoding.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO\backbone copying groundingdino\models\GroundingDINO\backbone\swin_transformer.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO\backbone copying groundingdino\models\GroundingDINO\backbone\init__.py -> build\lib.win-amd64-cpython-310\groundingdino\models\GroundingDINO\backbone running build_ext D:\AI\stable-diffusion-webui-1.1.0\venv\lib\site-packages\torch\utils\cpp_extension.py:359: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified warnings.warn(f'Error checking compiler version for {compiler}: {error}') building 'groundingdino._C' extension creating build\temp.win-amd64-cpython-310 creating build\temp.win-amd64-cpython-310\Release creating build\temp.win-amd64-cpython-310\Release\Users creating build\temp.win-amd64-cpython-310\Release\Users\PC creating build\temp.win-amd64-cpython-310\Release\Users\PC\AppData creating build\temp.win-amd64-cpython-310\Release\Users\PC\AppData\Local creating build\temp.win-amd64-cpython-310\Release\Users\PC\AppData\Local\Temp creating build\temp.win-amd64-cpython-310\Release\Users\PC\AppData\Local\Temp\pip-req-build-ly0skz5b creating build\temp.win-amd64-cpython-310\Release\Users\PC\AppData\Local\Temp\pip-req-build-ly0skz5b\groundingdino creating build\temp.win-amd64-cpython-310\Release\Users\PC\AppData\Local\Temp\pip-req-build-ly0skz5b\groundingdino\models creating build\temp.win-amd64-cpython-310\Release\Users\PC\AppData\Local\Temp\pip-req-build-ly0skz5b\groundingdino\models\GroundingDINO creating build\temp.win-amd64-cpython-310\Release\Users\PC\AppData\Local\Temp\pip-req-build-ly0skz5b\groundingdino\models\GroundingDINO\csrc creating build\temp.win-amd64-cpython-310\Release\Users\PC\AppData\Local\Temp\pip-req-build-ly0skz5b\groundingdino\models\GroundingDINO\csrc\MsDeformAttn "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DWITH_CUDA -IC:\Users\PC\AppData\Local\Temp\pip-req-build-ly0skz5b\groundingdino\models\GroundingDINO\csrc -ID:\AI\stable-diffusion-webui-1.1.0\venv\lib\site-packages\torch\include -ID:\AI\stable-diffusion-webui-1.1.0\venv\lib\site-packages\torch\include\torch\csrc\api\include -ID:\AI\stable-diffusion-webui-1.1.0\venv\lib\site-packages\torch\include\TH -ID:\AI\stable-diffusion-webui-1.1.0\venv\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -ID:\AI\stable-diffusion-webui-1.1.0\venv\include -IC:\Users\PC\AppData\Local\Programs\Python\Python310\include -IC:\Users\PC\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" /EHsc /TpC:\Users\PC\AppData\Local\Temp\pip-req-build-ly0skz5b\groundingdino\models\GroundingDINO\csrc\MsDeformAttn\ms_deform_attn_cpu.cpp /Fobuild\temp.win-amd64-cpython-310\Release\Users\PC\AppData\Local\Temp\pip-req-build-ly0skz5b\groundingdino\models\GroundingDINO\csrc\MsDeformAttn\ms_deform_attn_cpu.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 ms_deform_attn_cpu.cpp C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\cstdlib(12): fatal error C1083: Cannot open include file: 'math.h': No such file or directory error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe' failed with exit code 2 [end of output]

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

None GroundingDINO install failed. Please submit an issue to https://github.com/IDEA-Research/Grounded-Segment-Anything/issues.

amimi818 commented 1 year ago

重新安装cuda后重启计算机 了吗?@daizhuo

daizhuo commented 1 year ago

重新安装cuda后重启计算机 了吗?@daizhuo

Yeah!!!!!!! 感谢您的帮助啊,我重装了 Pytorch 就可以了........ 太多兼容性的问题,好头痛.......

lyx-JuneSnow commented 4 months ago

请问现在这个问题的解决方案就是降级CUDA版本到11.8,然后重装pytorh吗?