GroundingDINO
GroundingDINO copied to clipboard
UserWarning: Failed to load custom C++ ops. Running on CPU mode Only!
When I run : from groundingdino.models import build_model
I got this warning saying that I do not have access to GPU : UserWarning: Failed to load custom C++ ops. Running on CPU mode Only!
But, when I check with pytorch by running: torch.device('cuda' if torch.cuda.is_available() else 'cpu')
I get "cuda".
What is weird, is that I don't have this problem on google collab, but I do have it on the server of my laboratory. So what's wrong ?
I have the same problem. However, when I rerun it this warning disappeared.
Yes I saw that as well. But it appears even in the case of CPU. So the problem is not the warning, but the fact that the model will use GPU. Have you tried to compare the performance of the model with and without the warning ?
You should set CUDA_HOME before running the compiling for custom operator, you can check if there're CUDA_HOME be set in your env~
Thank you for you answer, I had indeed not set the CUDA_HOME variable in my environment. But still, i got the warning...
Could it comes from somewhere else ? Or maybe I need to re-install everything after having set the environmental variable CUDA_HOME ?
I get this warning even if I set CUDA_HOME. But, I am using the CUDA Docker image so I am not sure if anyone else gets it in the Docker image.
I get this warning even if I set CUDA_HOME. But, I am using the CUDA Docker image so I am not sure if anyone else gets it in the Docker image.
I experience the same issue with CUDA Docker image. Did you find a solution?
I experience the same issue with CUDA Docker image. Did you find a solution?
I run this script for my backend inside the container:
# !/bin/bash
if [ -d /app/model/GroundingDINO/ ]; then
echo "Files for GroundingDINO exists. Installing GroundingDINO"
cd /app/model/GroundingDINO/
pip install -e .
cd /app
else
echo "Files for GroundingDINO does not exists. Downloading GroundingDINO"
cd /app/model
git clone https://github.com/IDEA-Research/GroundingDINO.git
cd GroundingDINO
echo "Installing GroundingDINO"
pip install -e .
cd /app
fi
if ! [ -d /app/model/GroundingDINO/weights ]; then
echo "Downloading weights for GroundingDINO"
cd /app/model/GroundingDINO/
mkdir weights
cd weights
wget wget -q https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth
cd /app
fi
For some reason I have to manually install GroundingDino inside the container. I am not a big Docker expert. So if anyone knows why that happens please let me know.
I was able to build docker with CUDA using the following image @viktorpovazhuk @SSdevelop https://github.com/IDEA-Research/GroundingDINO/pull/307