-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NameError: name '_C' is not defined #15
Comments
You should set export CUDA_HOME=/path/to/cuda-11.3/
pip install ... |
In my case, |
@Andy1621 can you specify what you did? |
@jasonborn0 You have to make sure your Grounded-Segment-Anything/GroundingDINO/setup.py Lines 73 to 103 in ab1c44b
|
I met the same error with an annaconda env, and I solved it through:
This will install the groundingdino with GPU. But in my case, some extra library such as config, datasets miss after using the command above.
So I copy them into the env library, and it works! |
Hi Hsintein-Ng, could you please elaborate more on how you've installed on conda environmen? |
@kyungmnlee I install the conda environment through following https://github.com/facebookresearch/segment-anything |
It should be:
|
pip3 install Cython |
I run it OK ,but when I updated I fixed it by As above guys said
Have a try ! |
Is there any way to verify if it's installed via
|
I have set CUDA_HOME and install pytorch==1.10.0 with CUDA 11.3 and cudnn 8.2.0, and then install the groundingdino with both "python -m pip install -e GroundingDINO" and "cd GroundingDINO; python setup.py build; python setup.py install", but I still get the "Failed to load custom C++ ops. Running on CPU mode Only! " error. When I input "from groundingdino import _C" in python environment, it return "undefined symbol: _ZN6caffe28TypeMeta21_typeMetaDataInstanceIdEEPKNS_6detail12TypeMetaDataEv" error, what should I do? |
Simply setting up CUDA HOME, won't work it also needs the same CUDA version that the pytorch supports for e.g I have CUDA 12.1 setup and also the CUDA HOME pointing the same, yet I get this error when it tries to build _C file
|
For running on CPU, ignore the error add --cpu-only at the end of the command. I should work that way. |
In case of CUDA and PyTorch correct version mismatch, use command like this e.g "pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu114/torch_stable.html" Install PyTorch according to your CUDA version. |
Does ROCm not support it? |
And then I fixed all error...... That is crazy! |
Thanks, the above solution works!
Once again, please make sure your PyTorch wheel file is compatible with your CUDA version :) |
I met the same problem,then I solved it as follows:
|
I got the _C file as well under groundingdino, but i also failed to import it. The CUDA_HOME is set properly. |
same here Any suggestions? |
@BrandonHanx I installed GroundingDINO alone and it works, but when replacing it with the folder in MAM the issure remains. Have you solved it? |
try: ms_deform_attn.py:31 show error below : _C.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZNSt15__exception_ptr13exception_ptr9_M_addrefEv how can l sovel this problem? |
I encountered this issue in Win10, CUDA v11.7, and Python 3.10. By the way, I tested |
Thanks, artonnet. This also solves my issue! |
In my case the problem was caused by ABI incompatibility. System GCC was used at building time, but python binary comes from conda. Installing gcc/gxx from conda solves the issue:
|
That solve my problem as well. Thank you very much!!! |
I was using RHEL9 container |
This method was a great solution to this problem |
File "Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/ms_deform_attn.py", line 53, in forward
output = _C.ms_deform_attn_forward(
The text was updated successfully, but these errors were encountered: