czczup / ViT-Adapter

[ICLR 2023 Spotlight] Vision Transformer Adapter for Dense Predictions
https://arxiv.org/abs/2205.08534
Apache License 2.0
1.23k stars 137 forks source link

import error, I already cd ops & sh make.sh # compile deformable attention #101

Open nakuda1 opened 1 year ago

nakuda1 commented 1 year ago

Sorry to bother you. I already cd ops & sh make.sh # compile deformable attention in segmentation part When I run train.py in the segementation part, it has an error. Can you help me to solve it?

Traceback (most recent call last): File "train.py", line 11, in import mmseg_custom # noqa: F401,F403 File "/root/ViT-Adapter/segmentation/mmseg_custom/init.py", line 3, in from .models import # noqa: F401,F403 File "/root/ViT-Adapter/segmentation/mmseg_custom/models/init.py", line 2, in from .backbones import # noqa: F401,F403 File "/root/ViT-Adapter/segmentation/mmseg_custom/models/backbones/init.py", line 2, in from .beit_adapter import BEiTAdapter File "/root/ViT-Adapter/segmentation/mmseg_custom/models/backbones/beit_adapter.py", line 16, in from .adapter_modules import SpatialPriorModule, deform_inputs File "/root/ViT-Adapter/segmentation/mmseg_custom/models/backbones/adapter_modules.py", line 8, in from ops.modules import MSDeformAttn ModuleNotFoundError: No module named 'ops.modules'

image

windygoo commented 1 year ago

have you solved it? I meet the same issue.

duanduanduanyuchen commented 1 year ago

Hi, maybe you can try to run the command: export PYTHONPATH=\your\path\to\dir replace \your\path\to\dir by your path to the segmentation dir and run the code again.

czczup commented 1 year ago

If you meet dist_train.sh: Bad substitution when using cmd sh dist_train.sh, you can try bash dist_train.sh.

CX1888 commented 1 year ago

Solved. https://github.com/czczup/ViT-Adapter/issues/88