open-mmlab / mmsegmentation

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

No module named 'mmcv._ext' #126

Closed yangdonghan50 closed 4 years ago

yangdonghan50 commented 4 years ago

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. The bug has not been fixed in the latest version.

Reproduction python tools/train.py ./configs/sem_fpn/fpn_r50_512x512_160k_ade20k.py

Environment sys.platform: linux Python: 3.7.7 (default, May 7 2020, 21:25:33) [GCC 7.3.0] CUDA available: True CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 10.1, V10.1.243 GPU 0,1,2,3: TITAN Xp GCC: gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 PyTorch: 1.5.0 PyTorch compiling details: PyTorch built with:

TorchVision: 0.6.0a0+82fd1c8 OpenCV: 4.3.0 MMCV: 1.1.2 MMSegmentation: 0.6.0+c3e4dbc MMCV Compiler: n/a MMCV CUDA Compiler: n/a

Error traceback Traceback (most recent call last): File "tools/train.py", line 13, in from mmseg.apis import set_random_seed, train_segmentor File "/home/user/workspace/mmsegmentation/mmseg/apis/init.py", line 1, in from .inference import inference_segmentor, init_segmentor, show_result_pyplot File "/home/user/workspace/mmsegmentation/mmseg/apis/inference.py", line 8, in from mmseg.models import build_segmentor File "/home/user/workspace/mmsegmentation/mmseg/models/init.py", line 1, in from .backbones import * # noqa: F401,F403 File "/home/user/workspace/mmsegmentation/mmseg/models/backbones/init.py", line 1, in from .fast_scnn import FastSCNN File "/home/user/workspace/mmsegmentation/mmseg/models/backbones/fast_scnn.py", line 6, in from mmseg.models.decode_heads.psp_head import PPM File "/home/user/workspace/mmsegmentation/mmseg/models/decode_heads/init.py", line 13, in from .point_head import PointHead File "/home/user/workspace/mmsegmentation/mmseg/models/decode_heads/point_head.py", line 6, in from mmcv.ops import point_sample File "/home/user/workspace/mmcv/mmcv/ops/init.py", line 1, in from .bbox import bbox_overlaps File "/home/user/workspace/mmcv/mmcv/ops/bbox.py", line 3, in ext_module = ext_loader.load_ext('_ext', ['bbox_overlaps']) File "/home/user/workspace/mmcv/mmcv/utils/ext_loader.py", line 10, in load_ext ext = importlib.import_module('mmcv.' + name) File "/home/user/workspace/yes/envs/open-mmlab/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named 'mmcv._ext'

xvjiarui commented 4 years ago

Hi @yangdonghan50 You need to install mmcv-full for extension ops.

yangdonghan50 commented 4 years ago

@xvjiarui it works, thanks!

Liusandian commented 4 years ago

@xvjiarui it works, thanks!

did you mean use :pip install mmcv-full? or other instructions?

yangdonghan50 commented 4 years ago

@Liusandian pip install mmcv-full

neomukul commented 4 years ago

@Liusandian @xvjiarui with mmcv-full it advise to downgrade the mmcv. any workaround???