rerun-io / grounding-sam

Demo combining Grounding DINO with SAM (Segment Anything Model) visualized with Rerun
MIT License
2 stars 1 forks source link

How to install GroundedDINO? #4

Open sharkls opened 1 year ago

sharkls commented 1 year ago

when I install GroundedDINO, some problems were found.


(dino) root@3650:/data/myproject/code/grounding-sam/GroundingDINO# pip install -e .
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Obtaining file:///data/myproject/code/grounding-sam/GroundingDINO
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/data/myproject/code/grounding-sam/GroundingDINO/setup.py", line 29, in <module>
          from torch.utils.cpp_extension import CUDA_HOME, CppExtension, CUDAExtension
        File "/opt/conda/envs/dino/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 19, in <module>
          from .hipify import hipify_python
        File "/opt/conda/envs/dino/lib/python3.8/site-packages/torch/utils/hipify/hipify_python.py", line 34, in <module>
          from .cuda_to_hip_mappings import CUDA_TO_HIP_MAPPINGS
        File "/opt/conda/envs/dino/lib/python3.8/site-packages/torch/utils/hipify/cuda_to_hip_mappings.py", line 34, in <module>
          rocm_path = subprocess.check_output(["hipconfig", "--rocmpath"]).decode("utf-8")
        File "/opt/conda/envs/dino/lib/python3.8/subprocess.py", line 411, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "/opt/conda/envs/dino/lib/python3.8/subprocess.py", line 489, in run
          with Popen(*popenargs, **kwargs) as process:
        File "/opt/conda/envs/dino/lib/python3.8/subprocess.py", line 854, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/opt/conda/envs/dino/lib/python3.8/subprocess.py", line 1702, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      NotADirectoryError: [Errno 20] Not a directory: 'hipconfig'
      [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.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

My installation environment is as follows:

Package                  Version
------------------------ ----------
certifi                  2022.12.7
charset-normalizer       3.1.0
cmake                    3.26.3
Deprecated               1.2.13
filelock                 3.12.0
idna                     3.4
Jinja2                   3.1.2
lit                      16.0.2
MarkupSafe               2.1.2
mpmath                   1.3.0
networkx                 3.1
numpy                    1.24.3
nvidia-cublas-cu11       11.10.3.66
nvidia-cuda-cupti-cu11   11.7.101
nvidia-cuda-nvrtc-cu11   11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11        8.5.0.96
nvidia-cufft-cu11        10.9.0.58
nvidia-curand-cu11       10.2.10.91
nvidia-cusolver-cu11     11.4.0.1
nvidia-cusparse-cu11     11.7.4.91
nvidia-nccl-cu11         2.14.3
nvidia-nvtx-cu11         11.7.91
opencv-python            4.7.0.72
Pillow                   9.5.0
pip                      23.0.1
pyarrow                  10.0.1
requests                 2.28.2
rerun-sdk                0.5.0
segment-anything         1.0
setuptools               66.0.0
sympy                    1.11.1
torch                    2.0.0
torchvision              0.15.1
tqdm                     4.65.0
triton                   2.0.0
typing_extensions        4.5.0
urllib3                  1.26.15
wheel                    0.38.4
wrapt                    1.15.0
pablovela5620 commented 1 year ago

Are you using an AMD gpu with ROCm? It looks like a problem with hipconfig. Can you verify that its correctly installed using which hipconfig. I don't believe there's official support for ROCm for grounding dino. Might be best to open up that issue directly on the GroundingDINO repo. Would also be worth trying to install the repo directly following their install instructions https://github.com/IDEA-Research/GroundingDINO

lucienne999 commented 1 year ago

seems fixed in https://github.com/pytorch/pytorch/pull/99980/files