janghyuncho / DECOLA

Code release for "Language-conditioned Detection Transformer"
https://arxiv.org/abs/2311.17902
82 stars 4 forks source link

ModuleNotFoundError: No module named 'MultiScaleDeformableAttention' #7

Closed OrhanDg closed 3 months ago

OrhanDg commented 7 months ago

Can you please provide a solution or a recommandation for my problem below. I have already checked other respositories of MultiscaleDefomableAttention and I run my code in google colab environment with T4GPU but somehow I couldn't overcome this problem:

! python train_net.py --num-gpus 8 --config-file /content/DECOLA/configs/BoxSup-DeformDETR_Lbase_CLIP_SwinB_4x.yaml

Traceback (most recent call last):
  File "/content/DECOLA/train_net.py", line 50, in <module>
    from decola.config import add_detic_config
  File "/content/DECOLA/decola/__init__.py", line 11, in <module>
    from .modeling.decola import (decola_deformable_transformer, decola_deformable_detr, 
  File "/content/DECOLA/decola/modeling/decola/decola_deformable_transformer.py", line 10, in <module>
    from models.ops.modules import MSDeformAttn
  File "/content/DECOLA/third_party/Deformable-DETR/models/__init__.py", line 10, in <module>
    from .deformable_detr import build
  File "/content/DECOLA/third_party/Deformable-DETR/models/deformable_detr.py", line 38, in <module>
    from .deformable_transformer import build_deforamble_transformer
  File "/content/DECOLA/third_party/Deformable-DETR/models/deformable_transformer.py", line 21, in <module>
    from models.ops.modules import MSDeformAttn
  File "/content/DECOLA/third_party/Deformable-DETR/models/ops/modules/__init__.py", line 9, in <module>
    from .ms_deform_attn import MSDeformAttn
  File "/content/DECOLA/third_party/Deformable-DETR/models/ops/modules/ms_deform_attn.py", line 21, in <module>
    from ..functions import MSDeformAttnFunction
  File "/content/DECOLA/third_party/Deformable-DETR/models/ops/functions/__init__.py", line 9, in <module>
    from .ms_deform_attn_func import MSDeformAttnFunction
  File "/content/DECOLA/third_party/Deformable-DETR/models/ops/functions/ms_deform_attn_func.py", line 18, in <module>
    import MultiScaleDeformableAttention as MSDA
ModuleNotFoundError: No module named 'MultiScaleDeformableAttention'
janghyuncho commented 7 months ago

Hello, thank you for your interest in DECOLA!

It appears to be that the build has not been successful for the deformable attention modules. Could you follow the Deformable DETR's guide on building it? Should be here. Our installation should automatically compile all third-party modules but I am not sure what happened in your case.

Please try this and ask me if there is any other questions.