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
14.95k stars 1.39k forks source link

python -m pip install -e GroundingDINO 报错 #173

Open mls2009 opened 1 year ago

mls2009 commented 1 year ago

Obtaining file:///F:/AI/Grounded-Segment-Anything/GroundingDINO Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'error' error: subprocess-exited-with-error

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

[9 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "F:\AI\Grounded-Segment-Anything\GroundingDINO\setup.py", line 214, in ext_modules=get_extensions(), File "F:\AI\Grounded-Segment-Anything\GroundingDINO\setup.py", line 72, in get_extensions am_i_docker = os.environ.get('AM_I_DOCKER').casefold() in ['true', '1', 't'] AttributeError: 'NoneType' object has no attribute 'casefold' Building wheel groundingdino-0.1.0 [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.

fengyueyeah commented 1 year ago

Encountered the same bug,the following code fixes it: GroundingDINO/setup.py 72 am_i_docker = os.environ.get('AM_I_DOCKER') and os.environ.get('AM_I_DOCKER').casefold() in ['true', '1', 't'] 73 use_cuda = os.environ.get('BUILD_WITH_CUDA') and os.environ.get('BUILD_WITH_CUDA').casefold() in ['true', '1', 't']

rentainhe commented 1 year ago

Sorry for this issue, you can set the environment env as follows if you are not using docker env:

export AM_I_DOCKER=False
export BUILD_WITH_CUDA=True

Then running the installation

python -m pip install -e GroundingDINO
mls2009 commented 1 year ago

Sorry for this issue, you can set the environment env as follows if you are not using docker env:

export AM_I_DOCKER=False
export BUILD_WITH_CUDA=True

Then running the installation

python -m pip install -e GroundingDINO

Still getting error after running, and the error code is: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\crtdefs.h(10): fatal error C1083: 无法打开包括文件: “corecrt.h▒\x9d: No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit code 2

gukehan2000 commented 1 year ago

cuda路径你得自己改 他那个只是提示你改称cuda11.3路径