roboflow / roboflow/notebooks

NameError: name '_C' is not defined

Open
#367 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Jupyter Notebook
Stars
9.7k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Search before asking
  • I have searched the Roboflow Notebooks issues and found no similar bug report.
Notebook name

Below error is coming while running the colab file of zero-shot-object-detection-with-grounding-dino.ipynb in Google COLAB
from last few days, it was not there before.

FutureWarning: The device argument is deprecated and will be removed in v5 of Transformers.
UserWarning: torch.utils.checkpoint: the use_reentrant parameter should be passed explicitly. In version 2.5 we will raise an exception if use_reentrant is not passed. use_reentrant=False is recommended, but if you need to preserve the current default behavior, you can pass use_reentrant=True. 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

NameError Traceback (most recent call last)
in <cell line: 0>()
11 image_source, image = load_image(IMAGE_PATH)
12
---> 13 boxes, logits, phrases = predict(
14 model=model,
15 image=image,

22 frames
/content/GroundingDINO/groundingdino/models/GroundingDINO/ms_deform_attn.py 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

Bug

NameError: name '_C' is not defined

Environment

Google Colab

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?
  • Yes I'd like to help by submitting a PR!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with zero-shot-object-detection-with-grounding-dino.ipynb in Google Colab and reproduce the failure. Inspect /content/GroundingDINO/groundingdino/models/GroundingDINO/ms_deform_attn.py around line 53, where _C.ms_deform_attn_forward is called; done means the notebook's prediction step completes without the NameError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python, pytorch
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.