Grounded-Segment-Anything icon indicating copy to clipboard operation
Grounded-Segment-Anything copied to clipboard

Error: name '_C' is not defined , UserWarning: Failed to load custom C++ ops. Running on CPU mode Only!

Open XinyueZ opened this issue 1 year ago • 13 comments

torch version

torch                    1.13.1+cu116
torch-fidelity           0.3.0
torchmetrics             0.11.4
torchtyping              0.1.4
torchvision              0.14.1+cu116

Nvidia stuff

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.116.03   Driver Version: 525.116.03   CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA RTX A6000    Off  | 00000000:41:00.0 Off |                  Off |
| 30%   33C    P0    66W / 300W |      0MiB / 49140MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA RTX A6000    Off  | 00000000:81:00.0 Off |                  Off |
| 30%   35C    P0    68W / 300W |      0MiB / 49140MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   2  NVIDIA RTX A6000    Off  | 00000000:C1:00.0 Off |                  Off |
| 30%   34C    P0    65W / 300W |      0MiB / 49140MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

XinyueZ avatar May 07 '23 22:05 XinyueZ

Hello! You should set CUDA_HOME before you install GroundingDINO.

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

This is the deformable-attention operator needs CUDA runtime when being compiled

rentainhe avatar May 08 '23 02:05 rentainhe

@rentainhe this was my status quo setting:

$ cd /usr/local
$ ls
bin  cuda  cuda-11  cuda-11.8  etc  games  include  lib  man  sbin  share  src
$ CUDA_HOME='/usr/local/cuda

Must I set CUDA_HOME='/usr/local/cuda to CUDA_HOME=/path/to/cuda-11.3/ ????

thank you

XinyueZ avatar May 08 '23 05:05 XinyueZ

Hi @XinyueZ I'm facing a similar error did find a solution please?

assia855 avatar May 11 '23 11:05 assia855

yes, explicitly do export CUDA_HOME=/path/to/cuda-11.3/ or 11.8

then pip install....

XinyueZ avatar May 11 '23 11:05 XinyueZ

Thanks for your reply. After ppassing: export CUDA_HOME=/path/to/cuda-11.3/ it doesn't work. I have this error: error: [Errno 2] No such file or directory: '/path/to/cuda-11.3/bin/nvcc'

assia855 avatar May 11 '23 12:05 assia855

Thanks for your reply. After ppassing: export CUDA_HOME=/path/to/cuda-11.3/ it doesn't work. I have this error: error: [Errno 2] No such file or directory: '/path/to/cuda-11.3/bin/nvcc'

You should check the specific path in your env for CUDA-Runtime and set the specific path to it

rentainhe avatar May 11 '23 13:05 rentainhe

@rentainhe this was my status quo setting:

$ cd /usr/local
$ ls
bin  cuda  cuda-11  cuda-11.8  etc  games  include  lib  man  sbin  share  src
$ CUDA_HOME='/usr/local/cuda

Must I set CUDA_HOME='/usr/local/cuda to CUDA_HOME=/path/to/cuda-11.3/ ????

thank you

CUDA_HOME='/usr/local/cudais OK, maybe you can try to remove the./build` folder and compile it again

rentainhe avatar May 11 '23 13:05 rentainhe

actually, I did do CUDA_HOME='/usr/local/cuda , but it did not work. then I explicitly assigned with version.

XinyueZ avatar May 11 '23 13:05 XinyueZ

我使用docker方式安装,遇到这个问题后进入GrouningDino目录,手动执行了一次安装:python setup.py install 运行成功

LeanFly avatar May 18 '23 11:05 LeanFly

Install without Docker,Run:

python -m pip install -e GroundingDINO

It works now

OyamingO avatar Jul 05 '23 03:07 OyamingO

我使用docker方式安装,遇到这个问题后进入GrouningDino目录,手动执行了一次安装:python setup.py install 运行成功

Uninstall the installed library before manually installing it: pip uninstall groundingdino

ganleiboy avatar Sep 18 '23 12:09 ganleiboy

我使用docker方式安装,遇到这个问题后进入GrouningDino目录,手动执行了一次安装:python setup.py install 运行成功

seems that "pip install -e ." does not work. Only python setup.py install works.

tingxueronghua avatar Feb 19 '24 08:02 tingxueronghua

我使用docker方式安装,遇到这个问题后进入GrouningDino目录,手动执行了一次安装:python setup.py install 运行成功

可以教下怎么使用docker安装吗,我用docker下载镜像,Dockerfile中的segment_anything和groundedDINO都编译不了,如果编译成功了又该怎么做成虚拟环境

artificialzjy avatar Mar 11 '24 09:03 artificialzjy