lichengunc / MAttNet

MAttNet: Modular Attention Network for Referring Expression Comprehension
http://vision2.cs.unc.edu/refer
MIT License
292 stars 74 forks source link

ImportError: No module named '_ext'` #37

Open KennithLi opened 3 years ago

KennithLi commented 3 years ago

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~

yujiapingff commented 3 years ago

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

sduzpp commented 2 years ago

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 您好 请问这个问题解决了吗

sduzpp commented 2 years ago

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?

KennithLi commented 2 years ago

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
FioPio commented 2 years ago

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