Skip to content

ImportError: No module named '_ext'` #37

Open

Description

@KennithLi

I complied mask-faster-rcnn with command as following and got succeeded:

cd pyutils/mask-faster-rcnn/lib/
make

But I got some errors when I ran MAttNet project:

Traceback (most recent call last):
  File "tools/extract_mrcn_head_feats.py", line 22, in <module>
    from mrcn import inference
  File "/home/lqz/data/refer_exp_com/MAttNet/tools/../lib/mrcn/inference.py", line 26, in <module>
    from nets.vgg16 import vgg16
  File "/home/lqz/data/refer_exp_com/MAttNet/tools/../pyutils/mask-faster-rcnn/lib/nets/vgg16.py", line 10, in <module>
    from nets.network import Network
  File "/home/lqz/data/refer_exp_com/MAttNet/tools/../pyutils/mask-faster-rcnn/lib/nets/network.py", line 21, in <module>
    from layer_utils.proposal_layer import proposal_layer
  File "/home/lqz/data/refer_exp_com/MAttNet/tools/../pyutils/mask-faster-rcnn/lib/layer_utils/proposal_layer.py", line 13, in <module>
    from model.nms_wrapper import nms
  File "/home/lqz/data/refer_exp_com/MAttNet/tools/../pyutils/mask-faster-rcnn/lib/model/nms_wrapper.py", line 11, in <module>
    from nms.pth_nms import pth_nms
  File "/home/lqz/data/refer_exp_com/MAttNet/tools/../pyutils/mask-faster-rcnn/lib/nms/pth_nms.py", line 2, in <module>
    from _ext import nms
ImportError: No module named '_ext'

Could anyone tell me how to resolve it?
Thanks~

Activity

  1. yujiapingff commented on Dec 18, 2020

    @yujiapingff

    I have also got this problem, I make is with anaconda environment with python3.5 and python2.7, none of them working

  2. sduzpp commented on Dec 6, 2021

    @sduzpp

    I complied mask-faster-rcnn with command as following and got succeeded:

    cd pyutils/mask-faster-rcnn/lib/
    make
    

    But I got some errors when I ran MAttNet project:

    Traceback (most recent call last):
      File "tools/extract_mrcn_head_feats.py", line 22, in <module>
        from mrcn import inference
      File "/home/lqz/data/refer_exp_com/MAttNet/tools/../lib/mrcn/inference.py", line 26, in <module>
        from nets.vgg16 import vgg16
      File "/home/lqz/data/refer_exp_com/MAttNet/tools/../pyutils/mask-faster-rcnn/lib/nets/vgg16.py", line 10, in <module>
        from nets.network import Network
      File "/home/lqz/data/refer_exp_com/MAttNet/tools/../pyutils/mask-faster-rcnn/lib/nets/network.py", line 21, in <module>
        from layer_utils.proposal_layer import proposal_layer
      File "/home/lqz/data/refer_exp_com/MAttNet/tools/../pyutils/mask-faster-rcnn/lib/layer_utils/proposal_layer.py", line 13, in <module>
        from model.nms_wrapper import nms
      File "/home/lqz/data/refer_exp_com/MAttNet/tools/../pyutils/mask-faster-rcnn/lib/model/nms_wrapper.py", line 11, in <module>
        from nms.pth_nms import pth_nms
      File "/home/lqz/data/refer_exp_com/MAttNet/tools/../pyutils/mask-faster-rcnn/lib/nms/pth_nms.py", line 2, in <module>
        from _ext import nms
    ImportError: No module named '_ext'
    

    Could anyone tell me how to resolve it? Thanks~

    @KennithLi 您好 请问这个问题解决了吗

  3. sduzpp commented on Dec 6, 2021

    @sduzpp

    I have also got this problem, I make is with anaconda environment with python3.5 and python2.7, none of them working

    hello , have you solved the problem,please?

  4. KennithLi commented on Dec 6, 2021

    @KennithLi
    Author

    I solved the problem by using a docker, which you can pull from the Nvidia website nvcr.io/nvidia/pytorch:18.05-py3.

    Commands

    # in the docker 
    apt-get update
    apt-get install libsm6 libxrender1 libglib2.0-dev libxext-dev
    cd /home/data/refer_exp_com/MAttNet
    
    cd pyutils/mask-faster-rcnn/lib/
    
    # using cuda-8.0
    export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
    export CPATH=/usr/local/cuda-8.0/include${CPATH:+:${CPATH}}
    export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
    
    make
    
  5. FioPio commented on May 5, 2022

    @FioPio

    @KennithLi Could you share your docker file please? It would help me a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions