Hi
I'm trying to perform faster-RCNN demo based on this page. When I try to run a sample model with python 3, it comes to errors like this:
ImportError: ../Lib/nms/gpu_nms.so: undefined symbol: _Py_ZeroStruct
I tried to comment this line:
from .nms.gpu_nms import gpu_nms
in nms_wrapprt.py and the error became like this:
ImportError: ../Lib/nms/cpu_nms.so: undefined symbol: _Py_ZeroStruct
Now when I comment this line also:
nms.cpu_nms import cpu_nms
the error changes to this:
ImportError: ../Lib/bbox_overlaps.so: undefined symbol: _Py_ZeroStruct
What can I do to make this .so files to work with python 3?
(Ubuntu 16.04
cuda 8.0
pyhton 2.7 and 3.5)
In $FasterRcnnRoot/lib/setup.py, add '/usr/include/python3.5m' to the include_dirs at line 123 and 140:
123: include_dirs = [numpy_include, '/usr/include/python3.5m']
140: include_dirs = [numpy_include, CUDA['include'], '/usr/include/python3.5m'] .
Then run make inside the $FasterRcnnRoot/lib/ folder to generate a new gpu_nms.so file inside $FasterRcnnRoot/lib/nms. Note that you need to remove the current gpu_nms.so in order to generate a new one.
Worked! Thanks @SamaraRen
@SamaraRen thanks, The only difference I do compared with you is I removed cpu_nms.so
Most helpful comment
In $FasterRcnnRoot/lib/setup.py, add '/usr/include/python3.5m' to the include_dirs at line 123 and 140:
123: include_dirs = [numpy_include, '/usr/include/python3.5m']
140: include_dirs = [numpy_include, CUDA['include'], '/usr/include/python3.5m'] .
Then run make inside the $FasterRcnnRoot/lib/ folder to generate a new gpu_nms.so file inside $FasterRcnnRoot/lib/nms. Note that you need to remove the current gpu_nms.so in order to generate a new one.