tgxs002 / CORA

A DETR-style framework for open-vocabulary detection (OVD). CVPR 2023
Apache License 2.0
165 stars 14 forks source link

No module named 'MultiScaleDeformableAttention' error #7

Closed youliangtan closed 1 year ago

youliangtan commented 1 year ago

I am getting this error, not too sure how to resolve it:

Traceback (most recent call last):
  File "/home/hrl_gpu_1/rl/CORA/main.py", line 22, in <module>
    from models import build_model
  File "/home/hrl_gpu_1/rl/CORA/models/__init__.py", line 1, in <module>
    from .fast_detr import build
  File "/home/hrl_gpu_1/rl/CORA/models/fast_detr.py", line 21, in <module>
    from .dab_transformer import build_transformer as build_dab_transformer
  File "/home/hrl_gpu_1/rl/CORA/models/dab_transformer.py", line 23, in <module>
    from models.ops.modules import MSDeformAttn
  File "/home/hrl_gpu_1/rl/CORA/models/ops/modules/__init__.py", line 9, in <module>
    from .ms_deform_attn import MSDeformAttn
  File "/home/hrl_gpu_1/rl/CORA/models/ops/modules/ms_deform_attn.py", line 21, in <module>
    from ..functions import MSDeformAttnFunction
  File "/home/hrl_gpu_1/rl/CORA/models/ops/functions/__init__.py", line 9, in <module>
    from .ms_deform_attn_func import MSDeformAttnFunction
  File "/home/hrl_gpu_1/rl/CORA/models/ops/functions/ms_deform_attn_func.py", line 18, in <module>
    import MultiScaleDeformableAttention as MSDA
ModuleNotFoundError: No module named 'MultiScaleDeformableAttention'
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 23686) of binary: /home/hrl_gpu_1/miniconda3/envs/cora/bin/python

My conda env is:

youliangtan commented 1 year ago

Okay, apparently the solution is to compile the cuda ops:

cd ./models/ops
sh ./make.sh

https://github.com/fundamentalvision/Deformable-DETR/issues/68