sd-webui-segment-anything icon indicating copy to clipboard operation
sd-webui-segment-anything copied to clipboard

[Bug]: NameError: name '_C' is not defined

Open psykokwak-com opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

Have you updated WebUI and this extension to the newest version?

  • [X] I have updated WebUI and this extension to the most up-to-date version

Do you understand that you should go to https://github.com/IDEA-Research/Grounded-Segment-Anything/issues if you cannot install GroundingDINO?

  • [X] My problem is not about installing GroundingDINO

What happened?

Trying to use the grounding dino mode. I get an error when I press "generate bounding box" The error is :

C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\transformers\modeling_utils.py:768: FutureWarning: The `device` argument is deprecated and will be removed in v5 of Transformers.
  warnings.warn(
Traceback (most recent call last):
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1075, in process_api    result = await self.call_function(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 884, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\sam.py", line 208, in dino_predict
    boxes_filt, install_success = dino_predict_internal(input_image, dino_model_name, text_prompt, box_threshold)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\dino.py", line 138, in dino_predict_internal
    boxes_filt = get_grounding_output(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\dino.py", line 114, in get_grounding_output
    outputs = model(image[None], captions=[caption])
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\groundingdino.py", line 313, in forward
    hs, reference, hs_enc, ref_enc, init_box_proposal = self.transformer(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\transformer.py", line 258, in forward
    memory, memory_text = self.encoder(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\transformer.py", line 576, in forward
    output = checkpoint.checkpoint(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\utils\checkpoint.py", line 249, in checkpoint
    return CheckpointFunction.apply(function, preserve, *args)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\utils\checkpoint.py", line 107, in forward
    outputs = run_function(*args)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\transformer.py", line 785, in forward
    src2 = self.self_attn(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\ms_deform_attn.py", line 338, in forward
    output = MultiScaleDeformableAttnFunction.apply(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\ms_deform_attn.py", line 53, in forward
    output = _C.ms_deform_attn_forward(
NameError: name '_C' is not defined

Steps to reproduce the problem

  1. Load an image in segment anything
  2. Select SAM model
  3. click on "Enable GroundingDINO"
  4. Select the grounding dino model
  5. Write my GroundingDINO Detection Prompt
  6. Select "I want to preview GroundingDINO detection result and select the boxes I want."
  7. Click "Generate bounding box"

What should have happened?

Generating the bounding boxes images

Commit where the problem happens

webui: 22bcc7be428c94e9408f589966c2040187245d81 extension: 166483413d1c8ddabe42de41a46455e08e09e9d5

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

Launching Web UI with arguments: --xformers --api --gradio-img2img-tool color-sketch

Console logs

venv "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI
Installing None
Installing onnxruntime-gpu...
Installing None
Installing opencv-python...
Installing None
Installing Pillow...



Installing sd-webui-controlnet requirement: fvcore
Installing sd-webui-controlnet requirement: pycocotools



Launching Web UI with arguments: --xformers --api --gradio-img2img-tool color-sketch
Loading weights [f93e6a50ac] from C:\Users\Jyce\Desktop\stable-diffusion-webui\models\Stable-diffusion\uberRealisticPornMerge_urpmv13.safetensors
Creating model from config: C:\Users\Jyce\Desktop\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(0):
Textual inversion embeddings skipped(1): nrealfixer
Model loaded in 5.7s (load weights from disk: 0.2s, create model: 0.4s, apply weights to model: 2.8s, apply half(): 0.5s, move model to device: 0.7s, load textual inversion embeddings: 1.0s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 15.7s (import torch: 1.5s, import gradio: 0.9s, import ldm: 0.6s, other imports: 1.0s, setup codeformer: 0.1s, load scripts: 3.2s, load SD checkpoint: 6.1s, create ui: 1.9s, gradio launch: 0.2s).
Installing sd-webui-segment-anything requirement: groundingdino
GroundingDINO install success.
Running GroundingDINO Inference
Initializing GroundingDINO GroundingDINO_SwinT_OGC (694MB)
final text_encoder_type: bert-base-uncased
Downloading (…)/main/tokenizer.json: 100%|██████████████████████████████████████████| 466k/466k [00:00<00:00, 6.83MB/s]
Downloading model.safetensors: 100%|████████████████████████████████████████████████| 440M/440M [00:06<00:00, 73.0MB/s]
Downloading: "https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swint_ogc.pth" to C:\Users\Jyce\Desktop\stable-diffusion-webui\extensions\sd-webui-segment-anything\models/grounding-dino\groundingdino_swint_ogc.pth
100%|███████████████████████████████████████████████████████████████████████████████| 662M/662M [00:09<00:00, 69.8MB/s]
C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\transformers\modeling_utils.py:768: FutureWarning: The `device` argument is deprecated and will be removed in v5 of Transformers.
  warnings.warn(
Traceback (most recent call last):
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1075, in process_api    result = await self.call_function(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 884, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\sam.py", line 208, in dino_predict
    boxes_filt, install_success = dino_predict_internal(input_image, dino_model_name, text_prompt, box_threshold)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\dino.py", line 138, in dino_predict_internal
    boxes_filt = get_grounding_output(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\dino.py", line 114, in get_grounding_output
    outputs = model(image[None], captions=[caption])
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\groundingdino.py", line 313, in forward
    hs, reference, hs_enc, ref_enc, init_box_proposal = self.transformer(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\transformer.py", line 258, in forward
    memory, memory_text = self.encoder(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\transformer.py", line 576, in forward
    output = checkpoint.checkpoint(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\utils\checkpoint.py", line 249, in checkpoint
    return CheckpointFunction.apply(function, preserve, *args)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\utils\checkpoint.py", line 107, in forward
    outputs = run_function(*args)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\transformer.py", line 785, in forward
    src2 = self.self_attn(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\ms_deform_attn.py", line 338, in forward
    output = MultiScaleDeformableAttnFunction.apply(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\ms_deform_attn.py", line 53, in forward
    output = _C.ms_deform_attn_forward(
NameError: name '_C' is not defined

Additional information

No response

psykokwak-com avatar Apr 15 '23 18:04 psykokwak-com

I think C++ did not compile due to some problem. This is GroundingDINO's problem. I will submit an issue there.

continue-revolution avatar Apr 15 '23 18:04 continue-revolution

https://github.com/IDEA-Research/Grounded-Segment-Anything/issues/53

Uninstall GroundingDINO via pip uninstall groundingdino and check the above issue for solution.

In your specific case, run pip uninstall groundingdino may not work because you are using some virtual environment. Either try initiating your virtual environment and run the command, or go to venv\lib\site-packages\ and remove all directories that contains name groundingdino.

continue-revolution avatar Apr 15 '23 19:04 continue-revolution

Ok, Here is what I did :

C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\Scripts>pip.exe uninstall groundingdino
Found existing installation: groundingdino 0.1.0
Uninstalling groundingdino-0.1.0:
  Would remove:
    c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino-0.1.0.dist-info\*
    c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\*
Proceed (Y/n)? Y
  Successfully uninstalled groundingdino-0.1.0

But I don't understand which library is referred to in the Grounded-Segment-Anything ticket.

psykokwak-com avatar Apr 15 '23 19:04 psykokwak-com

Ok, Here is what I did :

C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\Scripts>pip.exe uninstall groundingdino
Found existing installation: groundingdino 0.1.0
Uninstalling groundingdino-0.1.0:
  Would remove:
    c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino-0.1.0.dist-info\*
    c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages\groundingdino\*
Proceed (Y/n)? Y
  Successfully uninstalled groundingdino-0.1.0

But I don't understand which library is referred to in the Grounded-Segment-Anything ticket.

They are referring to groundingdino. If you search _C inside their issue you will see a bunch of similar issues related to this. If this one does not work, look for another. I would expect at least one of them should work. If none of them is working, submit an issue there and let me know here.

Another related repository: https://github.com/IDEA-Research/GroundingDINO You may also check issues here to see if anything is relevant.

continue-revolution avatar Apr 15 '23 19:04 continue-revolution

Thanks. I will check and let you know.

psykokwak-com avatar Apr 15 '23 19:04 psykokwak-com

I checked the similar issues but found no solution. I'm not an expert on that kind of stuff (cuda, python and so on). I'm afraid I cannot find the solution alone :(

psykokwak-com avatar Apr 15 '23 23:04 psykokwak-com

Try adding your CUDA_HOME to your environment variable and add 'set CUDA_HOME="<your cuda path>”' into your webui.dat file to the second line.

If this is not working, let me know your cuda version, cuda home and torch version. I will see what my windows cuda home looks like, and guess whether you have put in the current cuda path. Also people mention old cuda+torch is not working, so I’m not sure.

continue-revolution avatar Apr 15 '23 23:04 continue-revolution

If it’s not working when I wake up, I’ll try to install it on my windows to see what is going wrong.

continue-revolution avatar Apr 16 '23 00:04 continue-revolution

I have not installed the CUDA drivers. I guess A1111 uses the CUDA from "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\Lib\site-packages\torch\lib" ? I tried to put this line : set CUDA_HOME="C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\Lib\site-packages\torch\lib" But it changes nothing.

Here is the versions I use :

python: 3.10.6  •  torch: 1.13.1+cu117  •  xformers: 0.0.16rc425  •  gradio: 3.23.0  •  commit: 22bcc7be

psykokwak-com avatar Apr 16 '23 06:04 psykokwak-com

This is definitely not correct. Give me some time to try which path is possibly correct.

continue-revolution avatar Apr 16 '23 07:04 continue-revolution

It seems that you should install CUDA driver. Download cuda driver from https://developer.nvidia.com/cuda-11-7-0-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local and check whether you have CUDA_HOME on your environment variable path.

Another way that might work and I recommend you to try before installing cuda driver is to set CUDA_HOME='<your virtual environment>', in your case, it should be set CUDA_HOME="C:\Users\Jyce\Desktop\stable-diffusion-webui\venv". I'm not sure whether it will work, because this is from my observation of my linux environment.

Let me know if this helps. If this does not help, I'll try to find another way.

continue-revolution avatar Apr 16 '23 10:04 continue-revolution

I just installed CUDA then added

set CUDA_HOME="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7"

into my "webui-user.bat" file.

Then I deleted the "venv" folder and launched "webui-user.bat" to start from a fresh new install. And now I have the following error when starting groundingdino :

Installing sd-webui-segment-anything requirement: groundingdino
Traceback (most recent call last):
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\extensions\sd-webui-segment-anything\scripts\dino.py", line 36, in install_goundingdino
    launch.run_pip(
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\launch.py", line 129, in run_pip
    return run(f'"{python}" -m pip {args} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}")
  File "C:\Users\Jyce\Desktop\stable-diffusion-webui\launch.py", line 97, in run
    raise RuntimeError(message)
RuntimeError: Couldn't install sd-webui-segment-anything requirement: groundingdino.
Command: "C:\Users\Jyce\Desktop\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install git+https://github.com/IDEA-Research/GroundingDINO --prefer-binary
Error code: 1
stdout: Collecting git+https://github.com/IDEA-Research/GroundingDINO
  Cloning https://github.com/IDEA-Research/GroundingDINO to c:\users\jyce\appdata\local\temp\pip-req-build-97dni1y_
  Resolved https://github.com/IDEA-Research/GroundingDINO to commit c43cdb3a9583a3044711c034bfa2829ed20a88c0
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: torch in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from groundingdino==0.1.0) (1.13.1+cu117)
Requirement already satisfied: torchvision in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from groundingdino==0.1.0) (0.14.1+cu117)
Requirement already satisfied: transformers in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from groundingdino==0.1.0) (4.25.1)
Requirement already satisfied: addict in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from groundingdino==0.1.0) (2.4.0)
Requirement already satisfied: yapf in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from groundingdino==0.1.0) (0.32.0)
Requirement already satisfied: timm in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from groundingdino==0.1.0) (0.6.7)
Requirement already satisfied: numpy in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from groundingdino==0.1.0) (1.23.3)
Requirement already satisfied: opencv-python in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from groundingdino==0.1.0) (4.7.0.72)
Collecting supervision==0.4.0
  Using cached supervision-0.4.0-py3-none-any.whl (25 kB)
Requirement already satisfied: pycocotools in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from groundingdino==0.1.0) (2.0.6)
Requirement already satisfied: matplotlib in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from supervision==0.4.0->groundingdino==0.1.0) (3.7.1)
Requirement already satisfied: typing-extensions in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from torch->groundingdino==0.1.0) (4.5.0)
Requirement already satisfied: requests in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from torchvision->groundingdino==0.1.0) (2.25.1)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from torchvision->groundingdino==0.1.0) (9.4.0)
Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (0.13.3)
Requirement already satisfied: filelock in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (3.11.0)
Requirement already satisfied: tqdm>=4.27 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (4.65.0)
Requirement already satisfied: packaging>=20.0 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (23.1)
Requirement already satisfied: pyyaml>=5.1 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (6.0)
Requirement already satisfied: regex!=2019.12.17 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (2023.3.23)
Requirement already satisfied: huggingface-hub<1.0,>=0.10.0 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from transformers->groundingdino==0.1.0) (0.13.4)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->supervision==0.4.0->groundingdino==0.1.0) (4.39.3)
Requirement already satisfied: cycler>=0.10 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->supervision==0.4.0->groundingdino==0.1.0) (0.11.0)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->supervision==0.4.0->groundingdino==0.1.0) (2.8.2)
Requirement already satisfied: pyparsing>=2.3.1 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->supervision==0.4.0->groundingdino==0.1.0) (3.0.9)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->supervision==0.4.0->groundingdino==0.1.0) (1.4.4)
Requirement already satisfied: contourpy>=1.0.1 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->supervision==0.4.0->groundingdino==0.1.0) (1.0.7)
Requirement already satisfied: colorama in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from tqdm>=4.27->transformers->groundingdino==0.1.0) (0.4.6)
Requirement already satisfied: idna<3,>=2.5 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (4.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (1.26.15)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from requests->torchvision->groundingdino==0.1.0) (2022.12.7)
Requirement already satisfied: six>=1.5 in c:\users\jyce\desktop\stable-diffusion-webui\venv\lib\site-packages (from python-dateutil>=2.7->matplotlib->supervision==0.4.0->groundingdino==0.1.0) (1.16.0)
Building wheels for collected packages: groundingdino
  Building wheel for groundingdino (setup.py): started
  Building wheel for groundingdino (setup.py): finished with status 'error'
  Running setup.py clean for groundingdino
Failed to build groundingdino
Installing collected packages: supervision, groundingdino
  Running setup.py install for groundingdino: started
  Running setup.py install for groundingdino: finished with status 'error'

stderr:   Running command git clone --filter=blob:none --quiet https://github.com/IDEA-Research/GroundingDINO 'C:\Users\Jyce\AppData\Local\Temp\pip-req-build-97dni1y_'
  error: subprocess-exited-with-error

  python setup.py bdist_wheel did not run successfully.

psykokwak-com avatar Apr 16 '23 10:04 psykokwak-com

If I remove the "CUDA_HOME" from webui-user.bat it works!

psykokwak-com avatar Apr 16 '23 10:04 psykokwak-com

If I remove the "CUDA_HOME" from webui-user.bat it works!

Great! Seems that installing cuda is the key to success.

continue-revolution avatar Apr 16 '23 10:04 continue-revolution

I still have the same issue with cuda installed. It's unclear for me now how my webui-user.bat file should look like.

jhuisman-hp avatar Apr 17 '23 14:04 jhuisman-hp

I still have the same issue with cuda installed. It's unclear for me now how my webui-user.bat file should look like.

Check you windows environment path. There should be a CUDA_PATH inside your system environment variables. If not, manually add the correct cuda toolkit path to your environment variable. My path looks like C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1 (Do not download v12.1 on windows. It won't work. I develop on linux). The author of this issue ended up not changing webui-user.bat.

continue-revolution avatar Apr 17 '23 14:04 continue-revolution

I have the same problem in linux, how do I need to deal with it python: 3.10.9  •  torch: 1.13.1+cu117  •  xformers: 0.0.16rc425  •  gradio: 3.23.0  •  commit: [22bcc7be]•  checkpoint: [0ed158bb04]

xujipm avatar Apr 27 '23 02:04 xujipm