[AI- AI -mmdetection] ModuleNotFoundError: No module named 'mmdet.version'

 

I encountered such a problem when integrating mmdetection framework.

ModuleNotFoundError: No module named 'mmdet.version'

mmdetection framework set up process is easy to overlook the compilation process

root@48ea75026556:/mmdetection# python sg-pcr-client/pcr_agant_new.py 
Traceback (most recent call last):
  File "sg-pcr-client/pcr_agant_new.py", line 9, in <module>
    from pr_handler_new import PicRecHandler
  File "/home/mmxsrt/sg-pcr-client/pr_handler_new.py", line 4, in <module>
    from mmdet.apis import init_detector, inference_detector, show_result
  File "/mmdetection/mmdet/__init__.py", line 1, in <module>
    from .version import __version__, short_version
ModuleNotFoundError: No module named 'mmdet.version'
root@48ea75026556:/mmdetection# 

In fact, there is a docker in directory mmdetection-master

Which clearly describes the build process. Paste the code dockerfile

 1 ARG PYTORCH="1.1.0"
 2 ARG CUDA="10.0"
 3 ARG CUDNN="7.5"
 4 
 5 FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
 6 
 7 RUN apt-get update && apt-get install -y libglib2.0-0 libsm6 libxrender-dev libxext6
 8 
 9 # Install mmdetection
10 RUN conda install cython -y
11 RUN git clone https://github.com/open-mmlab/mmdetection.git /mmdetection
12 WORKDIR /mmdetection
13 RUN pip install -e .

 

The last step allows us to solve this problem compile key installation

RUN pip install -e .

After successful compilation

Installing collected packages: mmdet
  Found existing installation: mmdet 1.0rc0+unknown
    Uninstalling mmdet-1.0rc0+unknown:
      Successfully uninstalled mmdet-1.0rc0+unknown
  Running setup.py develop for mmdet
Successfully installed mmdet

At this point it said that it has completed the installation and environmental preparations. Models can be retrieved and the next training, reasoning, verification of the process.

 

Guess you like

Origin www.cnblogs.com/yangww/p/11582897.html
Recommended