Insightface: ImportError: No module named bbox

Created on 13 Oct 2018  ·  7Comments  ·  Source: deepinsight/insightface

您好!我运行SSH/test.py,出现一下错误:
Traceback (most recent call last):
File "test.py", line 6, in
from ssh_detector import SSHDetector
File "/home/fll/work/Face recognition project/Age_Estimation/insightface/SSH/ssh_detector.py", line 10, in
from rcnn.processing.bbox_transform import nonlinear_pred, clip_boxes
File "/home/fll/work/Face recognition project/Age_Estimation/insightface/SSH/rcnn/processing/bbox_transform.py", line 2, in
from ..cython.bbox import bbox_overlaps_cython
ImportError: No module named bbox

如何解决呢,谢谢!

Most helpful comment

You can also enter the folder where the Cython files are placed and simply run:
python setup.py build_ext --inplace

make sure the setup.py is in the folder.

All 7 comments

do make first

But it's error also , after 'make'.

I renamed bbox.cpython-36m-x86_64-linux-gnu.so to bbox.so.
Then get another error:
ImportError: /insightface/RetinaFace/rcnn/cython/bbox.so: undefined symbol: _Py_FalseStruct

Do you have any other method?
Thanks!

I just find my command python use python3, but my project use python2.
So, I make it with python2 setup.py build_ext --inplace again.

So the problem was solved.

You can also enter the folder where the Cython files are placed and simply run:
python setup.py build_ext --inplace

make sure the setup.py is in the folder.

thanks a lot!Anaconda user will also get this problem
Just enter into your conda env and run python setup.py build_ext --inplace(under Cython dir)

@tosonw
hi ,
I can use python 3.6 to test,
but I use pythoh2.7 not ,will error

I use your resolution
cd rcnn/cython$ python2 setup.py build_ext --inplace
running build_ext
skipping 'bbox.c' Cython extension (up-to-date)
skipping 'anchors.c' Cython extension (up-to-date)
skipping 'cpu_nms.c' Cython extension (up-to-date)
skipping 'gpu_nms.cpp' Cython extension (up-to-date)

then python2.7 test.py will
ImportError: Building module rcnn.cython.bbox failed: ["CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n"]

Could you help me?

@ltcs11
hi ,
I can use python 3.6 to test,
but I use pythoh2.7 not ,will error

I use your resolution
cd /rcnn/cython$ python2 setup.py build_ext --inplace
running build_ext
skipping 'bbox.c' Cython extension (up-to-date)
skipping 'anchors.c' Cython extension (up-to-date)
skipping 'cpu_nms.c' Cython extension (up-to-date)
skipping 'gpu_nms.cpp' Cython extension (up-to-date)

then python2.7 test.py will
ImportError: Building module rcnn.cython.bbox failed: ["CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n"]

Could you help me?

Was this page helpful?
0 / 5 - 0 ratings