Py-faster-rcnn: Compilation on Windows

Created on 5 Nov 2015  ·  12Comments  ·  Source: rbgirshick/py-faster-rcnn

Hi, I'm trying to compile this python version of Faster-RCNN on Windows.

The modification was like:

if 'CUDA_PATH_V7_0' in os.environ:
    home = os.environ['CUDA_PATH_V7_0']
    nvcc = pjoin(home, 'bin', 'nvcc.exe')

I fixed the path to fit Windows, and conquered some minor issues. Then I compiled utils\bbox.c, nms\cpu_nms.c, and nms.cpp succesfully. However, I failed when building nms.gpu_nms. Here're the triggered errors:

error: Don't know how to compile nms/nms_kernel.cu to build\temp.win-amd64-2.7\Release\nms/nms_lernel.obj

or sometimes

TypeError: can only concatenate list (not "dist") to list

Did you successfully run this code on Windows?

All 12 comments

anyone solved this issue?

Hello..
I was trying to use the code in windows as well..
I am using cygwin and anaconda to Build cython modules. I made the change you mentioned of 'nvcc.exe' and had to move the lib\x64 for cuda to a folder called lib64 not to alter the code..
but I still have an issue realted to MSVC I guess, even though I have Visual c++ 2008, when ever I call make in the lib directory I get this error message :
////////////////////////////////////////////////////////
python setup.py build_ext --inplace
running build_ext
Traceback (most recent call last):
File "setup.py", line 155, in
cmdclass={'build_ext': custom_build_ext},
File "C:\Users\Raniem\AppData\Local\Continuum\Anaconda2\lib\distutils\core.py"
, line 151, in setup
dist.run_commands()
File "C:\Users\Raniem\AppData\Local\Continuum\Anaconda2\lib\distutils\dist.py"
, line 953, in run_commands
self.run_command(cmd)
File "C:\Users\Raniem\AppData\Local\Continuum\Anaconda2\lib\distutils\dist.py"
, line 972, in run_command
cmd_obj.run()
File "C:\Users\Raniem\AppData\Local\Continuum\Anaconda2\lib\site-packages\cyth
on-0.23.4-py2.7-win-amd64.egg\Cython\Distutils\build_ext.py", line 164, in run
_build_ext.build_ext.run(self)
File "C:\Users\Raniem\AppData\Local\Continuum\Anaconda2\lib\distutils\command\
build_ext.py", line 339, in run
self.build_extensions()
File "setup.py", line 108, in build_extensions
customize_compiler_for_nvcc(self.compiler)
File "setup.py", line 81, in customize_compiler_for_nvcc
default_compiler_so = self.compiler_so
AttributeError: MSVCCompiler instance has no attribute 'compiler_so'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I would appreciate any help and advice ..

Best Regards

@RaniemAR hi RaniemAR,I also met this problem,have you solve this?

I comment the line “default_compiler_so = self.compiler_so”, then met "can only concatenate list (not "dist") to list".
Then i change the extra_compile_args to a list as xgdgsc said, i can start the VS compiler.
But i met the "Dont know how to compile cu" problem.

Hi, all. Has anyone solved this issue?

I guess that the MSVCCompiler doesn't have compiler_so.
Maybe we can install Mingw32 and use
python setup.py build -c mingw32

I met a a similar problem
@RaniemAR
All of a sudden we find solutions are similar
But still not successful
After such a long time,did you solved it?

caffe is not supported in windows yet

@RaniemAR I met a a similar problem

I am sorry Guys I am afraid I didn't. I had to give up trying!

I builded module manually in VS17
python3.7 @ C:\Tools\Python37
cuda10.1 @ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
from lib\nms dir.

  1. run in cmd: "nvcc -arch=sm_52 --ptxas-options=-v -c --compiler-options /MD nms_kernel.cu"
    gives nms_kernel.obj
  2. in x64 native tools from VS: "cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Tools\Python37\lib\site-packages\numpy\core\include -IC:\Tools\Python37\include /EHsc /Tpgpu_nms.cpp /Fogpu_nms.obj"
    gives gpu_nms.obj
  3. "link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\lib\x64" /LIBPATH:C:\Tools\Python37\libs cudart.lib /EXPORT:PyInit_gpu_nms gpu_nms.obj nms_kernel.obj /OUT:gpu_nms.cp37-win_amd64.pyd"

Not sure if it works, cause for training it requres cuda compute cap 7.5, and i have only 5.2, but it builded sucessfully

Was this page helpful?
0 / 5 - 0 ratings