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.87k stars 1.38k forks source link

NameError: name '_C' is not defined on Colab (using GPU) #171

Open souvik0306 opened 1 year ago

souvik0306 commented 1 year ago
/usr/local/lib/python3.9/dist-packages/transformers/modeling_utils.py:862: FutureWarning: The `device` argument is deprecated and will be removed in v5 of Transformers.
  warnings.warn(
/usr/local/lib/python3.9/dist-packages/torch/utils/checkpoint.py:31: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
  warnings.warn("None of the inputs have requires_grad=True. Gradients will be None")
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
[<ipython-input-13-c132e245a3f3>](https://localhost:8080/#) in <cell line: 1>()
----> 1 annotated_frame, detected_boxes = detect(image, text_prompt=object_to_segment, model=groundingdino_model)
      2 Image.fromarray(annotated_frame)

16 frames
[/content/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/ms_deform_attn.py](https://localhost:8080/#) in forward(ctx, value, value_spatial_shapes, value_level_start_index, sampling_locations, attention_weights, im2col_step)
     51     ):
     52         ctx.im2col_step = im2col_step
---> 53         output = _C.ms_deform_attn_forward(
     54             value,
     55             value_spatial_shapes,

NameError: name '_C' is not defined
rentainhe commented 1 year ago

do you set CUDA_HOME before running the installation? if not, you can set it as:

export CUDA_HOME=/path/to/cuda-11.3
souvik0306 commented 1 year ago

it was working fine on colab without any such changes

Kurinosuke118 commented 1 year ago

Did you manage to solve it?

souvik0306 commented 1 year ago

Did you manage to solve it?

Yeah -> https://colab.research.google.com/drive/1n70h2AKV3MI24qorndCWmUl2MBSMxUjS?usp=sharing