坑1:在 rcnn/cython 中执行 py setup.py build_ext --inplace,

出现错误 “AttributeError: 'MSVCCompiler' object has no attribute 'compiler_so'” 

修改方法:

https://github.com/deepinsight/insightface/issues/679#issuecomment-495870070   ( 感谢 loscheris )

Instead of using python implementation, you can try to compile *.pyx files into windows binaries (*.pyd) :

  1. Replace setup.py in RetinaFace/rcnn/cython dir to:
    # setup.py
    from distutils.core import setup, Extension
    from Cython.Build import cythonize
    import numpy
    
    setup(
        ext_modules=cythonize(["bbox.pyx", "anchors.pyx", "cpu_nms.pyx"]),
        include_dirs=[numpy.get_include()]
    )

     

  2. Use cmd to run python setup.py build_ext --inplace in RetinaFace/rcnn/cython dir

  3. Copy the three windows binaries (*.pyd) generated in RetinaFace/rcnn/cython/rcnn/cpython to RetinaFace/rcnn/cython

  4. Run the test code : )

坑2:ValueError: buffer dtype mismatch, expected 'int_t' but got 'long long'

解决方法:https://github.com/CharlesShang/FastMaskRCNN/issues/163#issuecomment-338623985 (感谢 mengcz13)

Fixed by changing line 25 of cpu_num.pyx from

cdef np.ndarray[np.int_t, ndim=1] order = scores.argsort()[::-1]

to

cdef np.ndarray[np.intp_t, ndim=1] order = scores.argsort()[::-1]

I am having some problems when compiling gpu_nms.pyx on Windows Server, and I am using cpu_nms. Still I don't know what will happen if you use gpu_nms...

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐