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

Can not install groundingdino !!! Help #167

Open Shelton0215 opened 1 year ago

Shelton0215 commented 1 year ago

When I run python -m pip install -e GroundingDINO

There are some issues:

Installing collected packages: groundingdino Running setup.py develop for groundingdino error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [90 lines of output]
    Building wheel groundingdino-0.1.0
    Compiling with CUDA
    running develop
    running egg_info
    writing groundingdino.egg-info/PKG-INFO
    writing dependency_links to groundingdino.egg-info/dependency_links.txt
    writing requirements to groundingdino.egg-info/requires.txt
    writing top-level names to groundingdino.egg-info/top_level.txt
    reading manifest file 'groundingdino.egg-info/SOURCES.txt'
    adding license file 'LICENSE'
    writing manifest file 'groundingdino.egg-info/SOURCES.txt'
    running build_ext
    building 'groundingdino._C' extension
    Emitting ninja build file /media/ll/新加卷/seg_anything/Grounded-Segment-Anything/GroundingDINO/build/temp.linux-x86_64-cpython-38/build.ninja...
    Compiling objects...
    Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)

python setup.py develop did not run successfully. │ exit code: 1 ╰─> [90 lines of output] Building wheel groundingdino-0.1.0 Compiling with CUDA running develop running egg_info writing groundingdino.egg-info/PKG-INFO writing dependency_links to groundingdino.egg-info/dependency_links.txt writing requirements to groundingdino.egg-info/requires.txt writing top-level names to groundingdino.egg-info/top_level.txt reading manifest file 'groundingdino.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'groundingdino.egg-info/SOURCES.txt' running build_ext building 'groundingdino._C' extension Emitting ninja build file /media/ll/新加卷/seg_anything/Grounded-Segment-Anything/GroundingDINO/build/temp.linux-x86_64-cpython-38/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)

RuntimeError: Error compiling objects for extension
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

rentainhe commented 1 year ago

Hello, do you have set CUDA_HOME before running installation

rentainhe commented 1 year ago

Hello, do you have set CUDA_HOME before running installation

GroundingDINO need CUDA Runtime, meybe you should set CUDA_HOME before installation as:

export CUDA_HOME=/path/to/cuda-11.3/

an example

SpongeGirl commented 1 year ago

Probably you should upgrade your torch version, i've installed torch1.12.1 and it can work, but torch1.7 can't compile success on windows (success on linux).

rentainhe commented 1 year ago

Yes, here is my env for Grounded-SAM:

Package                 Version
----------------------- ------------------
absl-py                 1.4.0
addict                  2.4.0
aiofiles                23.1.0
aiohttp                 3.8.4
aiosignal               1.3.1
altair                  4.2.2
antlr4-python3-runtime  4.9.3
anyio                   3.6.2
asttokens               2.0.8
async-timeout           4.0.2
attrs                   22.2.0
backcall                0.2.0
black                   23.3.0
brotlipy                0.7.0
cachetools              5.3.0
certifi                 2022.12.7
cffi                    1.15.1
charset-normalizer      2.0.4
click                   8.1.3
cloudpickle             2.2.1
cmake                   3.26.3
coloredlogs             15.0.1
contourpy               1.0.7
controlnet-aux          0.0.2
cryptography            39.0.1
cycler                  0.11.0
dataclasses-json        0.5.7
debugpy                 1.6.3
decorator               5.1.1
diffusers               0.14.0
distlib                 0.3.6
einops                  0.6.0
entrypoints             0.4
executing               1.1.1
fastapi                 0.95.0
ffmpeg-python           0.2.0
ffmpy                   0.3.0
filelock                3.10.7
flatbuffers             23.3.3
flit_core               3.8.0
fonttools               4.39.3
frozenlist              1.3.3
fsspec                  2023.4.0
future                  0.18.3
fvcore                  0.1.5.post20221221
google-auth             2.17.2
google-auth-oauthlib    1.0.0
gradio                  3.25.0
gradio_client           0.1.0
greenlet                2.0.2
grpcio                  1.53.0
h11                     0.14.0
httpcore                0.17.0
httpx                   0.24.0
huggingface-hub         0.13.3
humanfriendly           10.0
hydra-core              1.3.2
idna                    3.4
importlib-metadata      6.1.0
importlib-resources     5.12.0
iopath                  0.1.9
ipykernel               6.16.0
ipython                 8.5.0
jedi                    0.18.1
Jinja2                  3.1.2
jsonschema              4.17.3
jupyter_client          7.4.3
jupyter_core            4.11.2
kiwisolver              1.4.4
langchain               0.0.101
linkify-it-py           2.0.0
lit                     16.0.1
llvmlite                0.39.1
Markdown                3.4.3
markdown-it-py          2.2.0
MarkupSafe              2.1.2
marshmallow             3.19.0
marshmallow-enum        1.5.1
matplotlib              3.7.1
matplotlib-inline       0.1.6
mdit-py-plugins         0.3.3
mdurl                   0.1.2
mkl-fft                 1.3.1
mkl-random              1.2.2
mkl-service             2.4.0
more-itertools          9.1.0
mpmath                  1.3.0
multidict               6.0.4
mypy-extensions         1.0.0
nest-asyncio            1.5.6
numba                   0.56.4
numpy                   1.23.5
oauthlib                3.2.2
omegaconf               2.3.0
onnx                    1.13.1
onnxruntime             1.14.1
openai                  0.27.4
openai-whisper          20230314
opencv-python           4.7.0.72
orjson                  3.8.10
packaging               23.0
pandas                  2.0.0
parso                   0.8.3
pathspec                0.11.1
pexpect                 4.8.0
pickleshare             0.7.5
Pillow                  9.4.0
pip                     23.0.1
pkgutil_resolve_name    1.3.10
platformdirs            3.2.0
portalocker             2.7.0
prompt-toolkit          3.0.31
protobuf                3.20.3
psutil                  5.9.4
ptyprocess              0.7.0
pure-eval               0.2.2
pyasn1                  0.4.8
pyasn1-modules          0.2.8
pycocotools             2.0.6
pycparser               2.21
pydantic                1.10.7
pydub                   0.25.1
Pygments                2.13.0
pyOpenSSL               23.0.0
pyparsing               3.0.9
pyrsistent              0.19.3
PySocks                 1.7.1
python-dateutil         2.8.2
python-multipart        0.0.6
pytz                    2023.3
PyYAML                  6.0
pyzmq                   24.0.1
regex                   2023.3.23
requests                2.28.1
requests-oauthlib       1.3.1
rsa                     4.9
scipy                   1.10.1
semantic-version        2.10.0
setuptools              65.6.3
six                     1.16.0
sniffio                 1.3.0
SQLAlchemy              1.4.47
stack-data              0.5.1
starlette               0.26.1
supervision             0.3.2
sympy                   1.11.1
tabulate                0.9.0
tenacity                8.2.2
tensorboard             2.12.1
tensorboard-data-server 0.7.0
tensorboard-plugin-wit  1.8.1
termcolor               2.2.0
tiktoken                0.3.1
timm                    0.6.13
tokenizers              0.13.3
tomli                   2.0.1
toolz                   0.12.0
torch                   1.12.1
torchaudio              0.12.1
torchvision             0.13.1
tornado                 6.2
tqdm                    4.65.0
traitlets               5.5.0
transformers            4.27.4
triton                  2.0.0
typing_extensions       4.4.0
typing-inspect          0.8.0
tzdata                  2023.3
uc-micro-py             1.0.1
urllib3                 1.26.15
uvicorn                 0.21.1
virtualenv              20.21.0
wcwidth                 0.2.5
websockets              11.0.1
Werkzeug                2.2.3
wheel                   0.38.4
yacs                    0.1.8
yapf                    0.32.0
yarl                    1.8.2
zipp                    3.15.0