open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
8.2k stars 2.6k forks source link

DLL load failed: 找不到指定的程序。 #1826

Closed endaoguansanlu closed 2 years ago

endaoguansanlu commented 2 years ago

D:\Python\lib\site-packages\mmcv\cnn\bricks\transformer.py:33: UserWarning: Fail to import MultiScaleDeformableAttention from mmcv.ops.multi_scale_deform_attn, You should install mmcv-full if you need this module. warnings.warn('Fail to import MultiScaleDeformableAttention from ' Traceback (most recent call last): File "e:/MyModel/train.py", line 13, in from mmsegmentation.mmseg.apis import set_random_seed, train_segmentor File "e:\MyModel\mmsegmentation\mmseg\apis__init.py", line 2, in from .inference import inference_segmentor, init_segmentor, show_result_pyplot from .decode_head import BaseDecodeHead File "e:\mymodel\mmsegmentation\mmseg\models\decode_heads\decode_head.py", line 11, in from ..losses import accuracy File "e:\mymodel\mmsegmentation\mmseg\models\losses__init__.py", line 6, in from .focal_loss import FocalLoss File "e:\mymodel\mmsegmentation\mmseg\models\losses\focal_loss.py", line 6, in from mmcv.ops import sigmoid_focal_loss as _sigmoid_focal_loss File "D:\Python\lib\site-packages\mmcv\ops__init__.py", line 2, in from .active_rotated_filter import active_rotated_filter File "D:\Python\lib\site-packages\mmcv\ops\active_rotated_filter.py", line 12, in ['active_rotated_filter_forward', 'active_rotated_filter_backward']) File "D:\Python\lib\site-packages\mmcv\utils\ext_loader.py", line 13, in load_ext ext = importlib.import_module('mmcv.' + name) File "D:\Python\lib\importlib\init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: DLL load failed: 找不到指定的程序。

I have this problem when I use mmsegmentation, do you know why, thanks!!

mm-assistant[bot] commented 2 years ago

We recommend using English or English & Chinese for issues so that we could have broader discussion.

xiexinch commented 2 years ago

Hi @endaoguansanlu, It seems that mmcv-full is not properly installed, you could try to reinstall mmcv-full with the following command.

pip uninstall mmcv
pip install openmim
mim install mmcv-full
endaoguansanlu commented 2 years ago

Hi @endaoguansanlu, It seems that mmcv-full is not properly installed, you could try to reinstall mmcv-full with the following command.

pip uninstall mmcv
pip install openmim
mim install mmcv-full

Thank you very much for your selfless help. Currently this problem has been solved, but I have this problem when importing build_segmentor, do you know how to solve it? thank you very much!!! Traceback (most recent call last): File "e:/MyModel/train.py", line 15, in from mmsegmentation.mmseg.models import build_segmentor File "e:\MyModel\mmsegmentation\mmseg\models__init.py", line 2, in from .backbones import * # noqa: F401,F403 File "e:\MyModel\mmsegmentation\mmseg\models\backbones__init__.py", line 2, in from .beit import BEiT File "e:\MyModel\mmsegmentation\mmseg\models\backbones\beit.py", line 17, in from ..builder import BACKBONES File "e:\MyModel\mmsegmentation\mmseg\models\builder.py", line 8, in MODELS = Registry('models', parent=MMCV_MODELS) File "D:\Python\lib\site-packages\mmcv\utils\registry.py", line 127, in init__ parent._add_children(self) File "D:\Python\lib\site-packages\mmcv\utils\registry.py", line 254, in _add_children f'scope {registry.scope} exists in {self.name} registry' AssertionError: scope mmseg exists in model registry

xiexinch commented 2 years ago

Could you show the codes you modified if possible? The scope is usually registered only once.

MengzhangLI commented 2 years ago

Another potential reason: Sometimes this error happens when certain libaries installation are not complete, or certain libaries are overlapped or destroyed thus they can not be imported and program does not know corresponding libaries.

I met this error before and it happened in PIL, so I suggest you go through your environment packages to check whether they are correct, you could locate your wrong library and uninstall & install it like below:

First

pip uninstall Pillow

And then

pip install Pillow