Closed psykokwak-com closed 1 year ago
I think C++ did not compile due to some problem. This is GroundingDINO's problem. I will submit an issue there.
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
.
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.
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.
Thanks. I will check and let you know.
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 :(
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.
If it’s not working when I wake up, I’ll try to install it on my windows to see what is going wrong.
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
This is definitely not correct. Give me some time to try which path is possibly correct.
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.
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.
If I remove the "CUDA_HOME" from webui-user.bat it works!
If I remove the "CUDA_HOME" from webui-user.bat it works!
Great! Seems that installing cuda is the key to success.
I still have the same issue with cuda installed. It's unclear for me now how my webui-user.bat file should look like.
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.
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]
Is there an existing issue for this?
Have you updated WebUI and this extension to the newest version?
Do you understand that you should go to https://github.com/IDEA-Research/Grounded-Segment-Anything/issues if you cannot install GroundingDINO?
What happened?
Trying to use the grounding dino mode. I get an error when I press "generate bounding box" The error is :
Steps to reproduce the problem
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
Console logs
Additional information
No response