IDEA-Research / Grounded-Segment-Anything

Grounded SAM: Marrying Grounding DINO with Segment Anything & Stable Diffusion & Recognize Anything - Automatically Detect , Segment and Generate Anything
https://arxiv.org/abs/2401.14159
Apache License 2.0
14.96k stars 1.39k forks source link

我成功安装了groundingdino,使用3090可以跑通代码,但是使用A100或者V100的时候会报error in ms_deformable_im2col_cuda: no kernel image is available for execution on the device的错误 #355

Open zdxff opened 1 year ago

zdxff commented 1 year ago

在使用3090的时候可以完整的运行代码,但是使用A100或者V100的时候会报错,cudatoolkit版本是11.3,pytorch是1.12,请问要怎么解决呢

rentainhe commented 1 year ago

A100和V100是集群机器吗还是,你可以检查一下是否在那两个环境下有CUDA_HOME这个环境变量,确保这个环境变量指向你的CUDA,然后再重新安装Grounding-DINO

zdxff commented 1 year ago

是集群机器,会有影响吗?已经配置了cuda_home变量了,需要重新clone吗,还是只需要删掉build

rentainhe commented 1 year ago

是集群机器,会有影响吗?已经配置了cuda_home变量了,需要重新clone吗,还是只需要删掉build

只需要删掉Build,再重新安装一次试试

zdxff commented 1 year ago

还是不行QWQ但是3090跑没问题

rentainhe commented 1 year ago

还是不行QWQ但是3090跑没问题

可以检查一下GCC的版本是不是太高了,之前有人出现太高版本也安装会报错

可以提供更多安装过程中的信息吗

zdxff commented 1 year ago

上个月跑成功了,谢谢你,我有两个cuda路径,选错了

ygtxr1997 commented 11 months ago

You may use this command to check whether the version between cuda used to build pytorch and runtime cuda is consistent:

python -m torch.utils.collect_env

Output (11.7 != 11.3, in my case):

...
CUDA used to build PyTorch: 11.7 
...
CUDA runtime version: 11.3.58 
...

Then, re-install a torch that has the same cuda suffix or re-install a cuda that has the same version with which torch depends. At last, following README.md, re-install Grounding_DINO and segment_anything by:

export AM_I_DOCKER=False
export BUILD_WITH_CUDA=True
export CUDA_HOME=/Your/Path/To/cuda/

# go to the repo directory
cd third_party/grounded_sam/

# install SAM
python -m pip install -e segment_anything

# install Grounding DINO
python -m pip install -e GroundingDINO
mggdzh commented 10 months ago

请问只能在linux上跑吗?windows上不行吗?

euminds commented 7 months ago

还是不行QWQ但是3090跑没问题

可以检查一下GCC的版本是不是太高了,之前有人出现太高版本也安装会报错

可以提供更多安装过程中的信息吗

我follow了安装过程还是出现 output = MultiScaleDeformableAttnFunction.apply( File "/home/user/rjt/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/ms_deform_attn.py", line 53, in forward output = _C.ms_deform_attn_forward( NameError: name '_C' is not defined

新建conda环境 conda create --name groundedsam python=3.8.5 conda activate groundedsam

export AM_I_DOCKER=False export BUILD_WITH_CUDA=True $CUDA_Home已经设置完毕 image

在安装时,由conda安装torch和torchvision conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch 注释掉GroundingDINO的requirements.txt的torch和torchvision避免自动安装torch 2.0造成torch和cuda不一致

安装 python -m pip install -e segment_anything

python -m pip install -e GroundingDINO 在运行grounded_sam_simple_demo.py时,出现NameError: name '_C' is not defined

Wonderland23 commented 3 months ago

在使用3090的时候可以完整的运行代码,但是使用A100或者V100的时候会报错,cudatoolkit版本是11.3,pytorch是1.12,请问要怎么解决呢

po主3090做推理的fps和所需内存您还记得吗,感谢!