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.11k stars 1.31k forks source link

Google Colaboratory sample notebook error (Unsupported TypeMeta in ATen) #492

Open hirokinaito opened 2 months ago

hirokinaito commented 2 months ago

Running the Google Colaboratory sample code (grounded_sam_colab_demo.ipynb) has been generating the following "Unsupported TypeMeta in ATen" error at detect method. This error occurred since this morning. It was working fine until yesterday.

Code:

annotated_frame, detected_boxes = detect(image, text_prompt="bench", model=groundingdino_model)
Image.fromarray(annotated_frame)

Error output:

FutureWarning: The `device` argument is deprecated and will be removed in v5 of Transformers.
UserWarning: torch.utils.checkpoint: please pass in use_reentrant=True or use_reentrant=False explicitly. The default value of use_reentrant will be updated to be False in the future. To maintain current behavior, pass use_reentrant=True. It is recommended that you use use_reentrant=False. Refer to docs for more details on the differences between the two variants.
UserWarning: None of the inputs have requires_grad=True. Gradients will be None
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
[<ipython-input-10-eb2d1c4b4783>](https://localhost:8080/#) in <cell line: 1>()
----> 1 annotated_frame, detected_boxes = detect(image, text_prompt="bench", model=groundingdino_model)
      2 Image.fromarray(annotated_frame)

24 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,

RuntimeError: Unsupported TypeMeta in ATen:  (please report this error)

My Google Colab runtime environment is GPU(T4).

Do you know a solution to this problem?

kshitizagarwal-dev commented 2 months ago

Getting the same error in colab

Anika-Tahsin-S commented 2 months ago

Same here. It was working just fine 3 days back. But now getting this error in colab.

'RuntimeError: Unsupported TypeMeta in ATen: (please report this error)'

TikaToka commented 2 months ago

Not in case of colab, but Remove the env and reinstalling it solved the problem for me.

karimelgazar commented 1 month ago

pip install --upgrade torch solved the issue for me

BinaryKevin commented 1 month ago

Same here. It was working just fine 3 days back. But now getting this error in colab.

'RuntimeError: Unsupported TypeMeta in ATen: (please report this error)'

Hi, have you solved this problem?

Morgan11-tech commented 1 month ago

I'm having the same error. pip install --upgrade torchdid not work