luca-medeiros/lang-segment-anything

ERROR: No matching distribution found for groundingdinoPlease read & provide the following

Closed this issue ยท 8 comments

Instructions To Reproduce the ๐Ÿ› Bug:

When I want to get the environment installed, I meet the error:
ERROR: Could not find a version that satisfies the requirement groundingdino (from versions: none)
ERROR: No matching distribution found for groundingdino

how can I fix this

I am also having problems with groundingdino. I am on an ssh connection to a server. In my case I get:

File "(...)/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/ms_deform_attn.py", line 53, in forward
   output = _C.ms_deform_attn_forward(NameError: name '_C' is not defined)

The full output:

`(...)/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/ms_deform_attn.py:31: UserWarning: Failed to load custom C++ ops. Running on CPU mode Only!
warnings.warn("Failed to load custom C++ ops. Running on CPU mode Only!")
(...)/.local/lib/python3.10/site-packages/torch/functional.py:507: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3549.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Some weights of the model checkpoint at bert-base-uncased were not used when initializing BertModel: ['cls.seq_relationship.weight', 'cls.seq_relationship.bias', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.transform.dense.bias', 'cls.predictions.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.LayerNorm.weight']

  • This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
  • This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
    /(...)/.local/lib/python3.10/site-packages/transformers/modeling_utils.py:884: FutureWarning: The device argument is deprecated and will be removed in v5 of Transformers.
    warnings.warn(
    (...)/.local/lib/python3.10/site-packages/torch/utils/checkpoint.py:460: 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.
    warnings.warn(
    (...)/.local/lib/python3.10/site-packages/torch/utils/checkpoint.py:90: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
    warnings.warn(
    Traceback (most recent call last):
    File "(...).py", line 19, in
    masks, boxes, labels, logits = model.predict(image_pil, text_prompt)
    File "(...)/.local/lib/python3.10/site-packages/lang_sam/lang_sam.py", line 116, in predict
    boxes, logits, phrases = self.predict_dino(image_pil, text_prompt, box_threshold, text_threshold)
    File "(...)/.local/lib/python3.10/site-packages/lang_sam/lang_sam.py", line 92, in predict_dino
    boxes, logits, phrases = predict(model=self.groundingdino,
    File "(...)/.local/lib/python3.10/site-packages/groundingdino/util/inference.py", line 68, in predict
    outputs = model(image[None], captions=[caption])
    File "(...)/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
    File "(...)/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
    File "(...)/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/groundingdino.py", line 327, in forward
    hs, reference, hs_enc, ref_enc, init_box_proposal = self.transformer(
    File "(...)/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
    File "(...)/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
    File "(...)/(...)/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/transformer.py", line 258, in forward
    memory, memory_text = self.encoder(
    File "(...)/(...)/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
    File "(...)(...)/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
    File "(.(...)/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/transformer.py", line 576, in forward
    output = checkpoint.checkpoint(
    File "/(...)/.local/lib/python3.10/site-packages/torch/_compile.py", line 24, in inner
    return torch._dynamo.disable(fn, recursive)(*args, **kwargs)
    File "/(...)/13/1/137970/.local/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 489, in _fn
    return fn(*args, **kwargs)
    File "/(...)0/.local/lib/python3.10/site-packages/torch/_dynamo/external_utils.py", line 17, in inner
    return fn(*args, **kwargs)
    File "/(...).local/lib/python3.10/site-packages/torch/utils/checkpoint.py", line 482, in checkpoint
    return CheckpointFunction.apply(function, preserve, *args)
    File "(...)/.local/lib/python3.10/site-packages/torch/autograd/function.py", line 553, in apply
    return super().apply(*args, **kwargs) # type: ignore[misc]
    File "/(...)/.local/lib/python3.10/site-packages/torch/utils/checkpoint.py", line 261, in forward
    outputs = run_function(*args)
    File "/(...)/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
    File "/(...)/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
    File "(...)/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/transformer.py", line 785, in forward
    src2 = self.self_attn(
    File "/(...)0/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
    File "/(...)/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
    File "(...)/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/ms_deform_attn.py", line 338, in forward
    output = MultiScaleDeformableAttnFunction.apply(
    File "(...).local/lib/python3.10/site-packages/torch/autograd/function.py", line 553, in apply
    return super().apply(*args, **kwargs) # type: ignore[misc]
    File "(...)/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/ms_deform_attn.py", line 53, in forward
    output = _C.ms_deform_attn_forward(
    NameError: name '_C' is not defined
    `

My problem turned out to be mentioned on installation guide for groundingdino.

Pip subprocess error: ERROR: Ignored the following versions that require a different python version: 1.2.0 Requires-Python >=3.9 ERROR: Could not find a version that satisfies the requirement groundingdino==0.1.0 (from versions: none) ERROR: No matching distribution found for groundingdino==0.1.0

I meet the same problem .
it seems groundingdino version 0.1.0 not exists ? and groundingdino version 1.2.0 require python 3.9 ?

Branch: main
Commit: f4ca296
ERROR: Ignored the following versions that require a different python version: 1.2.0 Requires-Python >=3.9 ERROR: Could not find a version that satisfies the requirement lang-sam==0.1.0 (from versions: none) ERROR: No matching distribution found for lang-sam==0.1.0

package lang-sam==0.1.0 not in pipy or conda-forge source ?

I successfully installed it with the following command.
Installation:

1.Clone the GroundingDINO repository from GitHub.

git clone https://github.com/IDEA-Research/GroundingDINO.git

Change the current directory to the GroundingDINO folder.

cd GroundingDINO/

Install the required dependencies in the current directory.
pip install -e .

But In lang_sam.py file, I detect that the model = build_model(args) command of the load_model_hf function cannot be executed. why?thank you

You can try pip install nw-groundingdino, this works for me.

I also encounter the same issue. It seems that the conda env use python 3.8, but some of the required packages do not support python 3.8 anymore.