ViT-Adapter icon indicating copy to clipboard operation
ViT-Adapter copied to clipboard

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

Open nakuda1 opened this issue 2 years ago • 4 comments

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

nakuda1 avatar May 27 '23 16:05 nakuda1

have you solved it? I meet the same issue.

windygoo avatar Jun 11 '23 08:06 windygoo

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.

duanduanduanyuchen avatar Jun 11 '23 15:06 duanduanduanyuchen

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

czczup avatar Jun 15 '23 10:06 czczup

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

CX1888 avatar Aug 19 '23 07:08 CX1888