Grounded-Segment-Anything icon indicating copy to clipboard operation
Grounded-Segment-Anything copied to clipboard

fail to install GroundingDINO

Open fiy-fiy opened this issue 1 year ago • 5 comments

ollecting mpmath>=0.19 (from sympy->torch->groundingdino==0.1.0) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl (536 kB) Collecting six>=1.5 (from python-dateutil>=2.7->matplotlib>=2.1.0->pycocotools->groundingdino==0.1.0) Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl (11 kB) Building wheels for collected packages: groundingdino Building editable for groundingdino (pyproject.toml) ... error error: subprocess-exited-with-error

× Building editable for groundingdino (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [135 lines of output] /tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/torch/nn/modules/transformer.py:20: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:84.) device: torch.device = torch.device(torch._C._get_default_device()), # torch.device('cpu'), Building wheel groundingdino-0.1.0 Compiling with CUDA running editable_wheel creating /tmp/pip-wheel-jyr6d1fl/.tmp-yzt0daed/groundingdino.egg-info writing /tmp/pip-wheel-jyr6d1fl/.tmp-yzt0daed/groundingdino.egg-info/PKG-INFO writing dependency_links to /tmp/pip-wheel-jyr6d1fl/.tmp-yzt0daed/groundingdino.egg-info/dependency_links.txt writing requirements to /tmp/pip-wheel-jyr6d1fl/.tmp-yzt0daed/groundingdino.egg-info/requires.txt writing top-level names to /tmp/pip-wheel-jyr6d1fl/.tmp-yzt0daed/groundingdino.egg-info/top_level.txt writing manifest file '/tmp/pip-wheel-jyr6d1fl/.tmp-yzt0daed/groundingdino.egg-info/SOURCES.txt' /tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/torch/utils/cpp_extension.py:502: 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.')) reading manifest file '/tmp/pip-wheel-jyr6d1fl/.tmp-yzt0daed/groundingdino.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file '/tmp/pip-wheel-jyr6d1fl/.tmp-yzt0daed/groundingdino.egg-info/SOURCES.txt' creating '/tmp/pip-wheel-jyr6d1fl/.tmp-yzt0daed/groundingdino-0.1.0.dist-info' creating /tmp/pip-wheel-jyr6d1fl/.tmp-yzt0daed/groundingdino-0.1.0.dist-info/WHEEL running build_py running build_ext Traceback (most recent call last): File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/setuptools/command/editable_wheel.py", line 156, in run self._create_wheel_file(bdist_wheel) File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/setuptools/command/editable_wheel.py", line 345, in _create_wheel_file files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/setuptools/command/editable_wheel.py", line 268, in _run_build_commands self._run_build_subcommands() File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/setuptools/command/editable_wheel.py", line 295, in _run_build_subcommands self.run_command(name) File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command super().run_command(command) File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 88, in run _build_ext.run(self) File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run self.build_extensions() File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 525, in build_extensions _check_cuda_version(compiler_name, compiler_version) File "/tmp/pip-build-env-365dpgjs/overlay/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 413, in _check_cuda_version raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda)) RuntimeError: The detected CUDA version (11.3) mismatches the version that was used to compile PyTorch (12.1). Please make sure to use the same CUDA versions.

fiy-fiy avatar Dec 06 '23 11:12 fiy-fiy

The detected CUDA version (11.3) mismatches the version that was used to compile PyTorch (12.1). Please make sure to use the same CUDA versions.

It seems like there're something wrong with PyTorch installation

rentainhe avatar Dec 06 '23 12:12 rentainhe

The detected CUDA version (11.3) mismatches the version that was used to compile PyTorch (12.1). Please make sure to use the same CUDA versions.

It seems like there're something wrong with PyTorch installation

I used the "pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113" install torch and cu113

fiy-fiy avatar Dec 06 '23 12:12 fiy-fiy

Got a similar message to @fiy-fiy above, except with CUDA 11.8 in my conda environment. Happy to share more info if you would like.

roboav8r avatar Dec 21 '23 02:12 roboav8r

I think you can try to delete the pyproject.toml since the building system was using a different Pytorch version from pyproject.toml, that works for me. refer to this comment

ybgdgh avatar Jan 01 '24 09:01 ybgdgh

I have successfully installed GrouningDino by this https://github.com/IDEA-Research/Grounded-Segment-Anything/issues/229#issuecomment-1552911223 you can try it

fiy-fiy avatar Jan 12 '24 09:01 fiy-fiy