按照官网 的提示,我开始安装faster rcnn,但是出现了很多问题,我将其汇总了起来,并提出了解决办法。
先说明一下我的配置:
- python : anaconda2
- linux: centos 6.9
安装faster rcnn请先参考:《cuda8+cudnn4 Faster R-CNN安装塈运行demo》
与 《使用cuDNN5编译py-faster-rcnn错误:cudnn.hpp(126): error: argument of type “int” is incompatible …》 ,要先合一下版本。
问题及解决方法
1.第三步Build the Cython modules 出现如下错误:
解决方法:
这个问题困扰了我好久,经过不断查阅资料,我终于解决了此问题。该问题主要是anaconda的 distutils.extension 在编译nms.gpu_nms出现的问题。
我的解决方法:
先定位到$FRCN_ROOT/lib,再打开setup.py,注释掉nms.gpu_nms模块:
# Extension('nms.gpu_nms',
# ['nms/nms_kernel.cu', 'nms/gpu_nms.pyx'],
# library_dirs=[CUDA['lib64']],
# libraries=['cudart'],
# language='c++',
# runtime_library_dirs=[CUDA['lib64']],
# # this syntax is specific to this build system
# # we're only going to use certain compiler args with nvcc and not with
# # gcc the implementation of this trick is in customize_compiler() below
# extra_compile_args={'gcc': ["-Wno-unused-function"],
# 'nvcc': ['-arch=sm_35',
# '--ptxas-options=-v',
# '-c',
# '--compiler-options',
# "'-fPIC'"]},
# include_dirs = [numpy_include, CUDA['include']]
# ),
然后先编译其他三个模块bbox,nms.cpu_nms,pycocotools._mask。
等到编译结束后,再回过来将上面的注释去掉,重新编译,会发现出现刚才的问题,此时&#