Grounded-Segment-Anything icon indicating copy to clipboard operation
Grounded-Segment-Anything copied to clipboard

Cannot run grounded_sam_colab_demo.ipynb, failed when installing (may relate to the update of pyproject.toml?)

Open lanlanyan0817 opened this issue 1 year ago • 2 comments

Hi, I have been using GroudedSAM for some time, but I encountered an error today when running the first cell to install in grounded_sam_colab_demo.ipynb:

/content/Grounded-Segment-Anything/GroundingDINO Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done error: subprocess-exited-with-error

× Building wheel for groundingdino (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. Building wheel for groundingdino (pyproject.toml) ... error ERROR: Failed building wheel for groundingdino ERROR: Could not build wheels for groundingdino, which is required to install pyproject.toml-based projects /content/Grounded-Segment-Anything/segment_anything Preparing metadata (setup.py) ... done Building wheel for segment-anything (setup.py) ... done /content/Grounded-Segment-Anything

Also another error when generating the boxes:

NameError Traceback (most recent call last) 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 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

Is the problem related to the update of the pyproject.toml two days ago because this problem didn't exist several days ago. Or other explanations for the problems? Maybe anyone else has the same problem currently when running this code on Google Colab?

lanlanyan0817 avatar Nov 17 '23 22:11 lanlanyan0817

same bug here

imiraoui avatar Nov 19 '23 00:11 imiraoui

try remove build and reinstall

pip install torch==2.0.1 torchvision==0.15.2

then

pip install -e .

crapthings avatar Nov 24 '23 15:11 crapthings