ModuleNotFoundError: No module named 'mmcv._ext'
See original GitHub issuehi,i’m new to the mmdetection and after using it for one day a few days ago,it seems that from last updates to mmdetection repository,installing it on colab is not the same! while commands below:
!pip install mmcv
!git clone https://github.com/open-mmlab/mmdetection.git
%cd mmdetection
!python setup.py develop
worked perfectly fine few days ago,now i get these logs from executing above:
/content/mmdetection running develop running egg_info writing mmdet.egg-info/PKG-INFO writing dependency_links to mmdet.egg-info/dependency_links.txt writing requirements to mmdet.egg-info/requires.txt writing top-level names to mmdet.egg-info/top_level.txt writing manifest file ‘mmdet.egg-info/SOURCES.txt’ /usr/local/lib/python3.6/dist-packages/torch/utils/cpp_extension.py:305: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja… Falling back to using the slow distutils backend. warnings.warn(msg.format(‘we could not find ninja.’)) running build_ext Creating /usr/local/lib/python3.6/dist-packages/mmdet.egg-link (link to .) mmdet 2.3.0rc0+f92765b is already the active version in easy-install.pth
Installed /content/mmdetection Processing dependencies for mmdet==2.3.0rc0+f92765b Searching for torchvision==0.6.1+cu101 Best match: torchvision 0.6.1+cu101 Adding torchvision 0.6.1+cu101 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for torch==1.5.1+cu101 Best match: torch 1.5.1+cu101 Adding torch 1.5.1+cu101 to easy-install.pth file Installing convert-caffe2-to-onnx script to /usr/local/bin Installing convert-onnx-to-caffe2 script to /usr/local/bin
Using /usr/local/lib/python3.6/dist-packages Searching for terminaltables==3.1.0 Best match: terminaltables 3.1.0 Adding terminaltables 3.1.0 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for six==1.12.0 Best match: six 1.12.0 Adding six 1.12.0 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for Pillow==6.2.2 Best match: Pillow 6.2.2 Adding Pillow 6.2.2 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for numpy==1.18.5 Best match: numpy 1.18.5 Adding numpy 1.18.5 to easy-install.pth file Installing f2py script to /usr/local/bin Installing f2py3 script to /usr/local/bin Installing f2py3.6 script to /usr/local/bin
Using /usr/local/lib/python3.6/dist-packages Searching for matplotlib==3.2.2 Best match: matplotlib 3.2.2 Adding matplotlib 3.2.2 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for future==0.16.0 Best match: future 0.16.0 Adding future 0.16.0 to easy-install.pth file Installing futurize script to /usr/local/bin Installing pasteurize script to /usr/local/bin
Using /usr/local/lib/python3.6/dist-packages Searching for pyparsing==2.4.7 Best match: pyparsing 2.4.7 Adding pyparsing 2.4.7 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for python-dateutil==2.8.1 Best match: python-dateutil 2.8.1 Adding python-dateutil 2.8.1 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for kiwisolver==1.2.0 Best match: kiwisolver 1.2.0 Adding kiwisolver 1.2.0 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for cycler==0.10.0 Best match: cycler 0.10.0 Adding cycler 0.10.0 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Finished processing dependencies for mmdet==2.3.0rc0+f92765b
which are different from the past. also after installing it like above,print_config functionality works fine,but train functionality and commands like:
from mmdet.apis.inference import show_result_pyplot,init_detector,inference_detector
return:
ModuleNotFoundError: No module named ‘mmcv._ext’
so,what is the problem?is it installing correctly? anything that i’m missing?!
thank u in advance!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
If you install it via
pip install mmcv
, the lite version is installed, which does not containmmcv._ext
.@liuzili97 @farshid-mi I solved this problem I met yesterday. Maybe you can check the result of
pip list
. I installmmcv-full
manually and then installmmdetection3d
. However,mmdeetection3d
will installmmcv
again automatically. Thus there are two versions ofmmcv
. Justpip uninstall mmcv
and this problem is fixed.