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.85k stars 1.37k forks source link

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

Open shenshen246 opened 1 year ago

shenshen246 commented 1 year ago

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

× git clone --filter=blob:none --quiet https://github.com/IDEA-Research/GroundingDINO 'C:\Users\Administrator\AppData\Local\Temp\pip-req-build-4s7iihdb' did not run successfully. │ exit code: 128 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. Traceback (most recent call last): File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\extensions\sd-webui-segment-anything\scripts\dino.py", line 67, in install_goundingdino launch.run_pip( File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\modules\launch_utils.py", line 124, in run_pip GroundingDINO install failed. Will fall back to local groundingdino this time. Please permanently switch to local groundingdino on Settings/Segment Anything or submit an issue to https://github.com/IDEA-Research/Grounded-Segment-Anything/issues. return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live) Running GroundingDINO Inference File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\modules\launch_utils.py", line 101, in run raise RuntimeError("\n".join(error_bits)) RuntimeError: Couldn't install sd-webui-segment-anything requirement: groundingdino. 提示:Python 运行时抛出了一个异常。请检查疑难解答页面。 Command: "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\python.exe" -m pip install git+https://github.com/IDEA-Research/GroundingDINO --prefer-binary --index-url https://mirror.baidu.com/pypi/simple Error code: 1 Initializing GroundingDINO GroundingDINO_SwinT_OGC (694MB) final text_encoder_type: bert-base-uncased Traceback (most recent call last): File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\transformers\utils\hub.py", line 409, in cached_file resolved_file = hf_hub_download( File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\huggingface_hub\utils_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\huggingface_hub\file_download.py", line 1259, in hf_hub_download raise LocalEntryNotFoundError( huggingface_hub.utils._errors.LocalEntryNotFoundError: Connection error, and we cannot find the requested files in the disk cache. Please try again or make sure your Internet connection is on.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\gradio\routes.py", line 422, in run_predict output = await app.get_blocks().process_api( File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\gradio\blocks.py", line 1323, in process_api result = await self.call_function( File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\gradio\blocks.py", line 1051, in call_function prediction = await anyio.to_thread.run_sync( File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\extensions\sd-webui-segment-anything\scripts\sam.py", line 200, in sam_predict boxes_filt, install_success = dino_predict_internal(input_image, dino_model_name, text_prompt, box_threshold) File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\extensions\sd-webui-segment-anything\scripts\dino.py", line 173, in dino_predict_internal dino_model = load_dino_model(dino_model_name, install_success) File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\extensions\sd-webui-segment-anything\scripts\dino.py", line 119, in load_dino_model dino = build_model(args) File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\extensions\sd-webui-segment-anything\local_groundingdino\models__init__.py", line 17, in build_model model = build_func(args) File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\extensions\sd-webui-segment-anything\local_groundingdino\models\GroundingDINO\groundingdino.py", line 362, in build_groundingdino model = GroundingDINO( File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\extensions\sd-webui-segment-anything\local_groundingdino\models\GroundingDINO\groundingdino.py", line 97, in init self.tokenizer = get_tokenlizer.get_tokenlizer(text_encoder_type) File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\extensions\sd-webui-segment-anything\local_groundingdino\util\get_tokenlizer.py", line 19, in get_tokenlizer tokenizer = AutoTokenizer.from_pretrained(text_encoder_type) File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\transformers\models\auto\tokenization_auto.py", line 597, in from_pretrained config = AutoConfig.from_pretrained( File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\transformers\models\auto\configuration_auto.py", line 809, in from_pretrained config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, kwargs) File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\transformers\configuration_utils.py", line 559, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, kwargs) File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\transformers\configuration_utils.py", line 614, in _get_config_dict resolved_config_file = cached_file( File "F:\SD\sd-webui-aki\sd-webui-aki-v4\sd-webui-aki-v4\py310\lib\site-packages\transformers\utils\hub.py", line 443, in cached_file raise EnvironmentError( OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like bert-base-uncased is not the path to a directory containing a file named config.json. 提示:Python 运行时抛出了一个异常。请检查疑难解答页面。 Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

rentainhe commented 1 year ago

It seems like you can not download pretrained BERT weights online, you can download it from huggingface and put it in a local dir and assign the pretrained weight path to solve this issue

or you can check your network to see if the weights can be downloaded online

rentainhe commented 1 year ago

BTW you seem to open three same issue for this: https://github.com/IDEA-Research/Grounded-Segment-Anything/issues/320 https://github.com/IDEA-Research/Grounded-Segment-Anything/issues/319, would you mind to close the redundant issues and only keep one of them?