py-faster-rcnn
py-faster-rcnn copied to clipboard
Make error
Hi @rbgirshick, Thanks for being so freaking awesome and porting it in Python.
I followed the installation instructions point-by-point but got stuck at the make step in $FRCN_ROOT/lib
I do not have cuda on my laptop, therefore, I tweaked the setup.py file to remove the cuda parts. See below -
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
import os
from os.path import join as pjoin
from setuptools import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import subprocess
import numpy as np
def find_in_path(name, path):
"Find a file in a search path"
#adapted fom http://code.activestate.com/recipes/52224-find-a-file-given-a-search-path/
for dir in path.split(os.pathsep):
binpath = pjoin(dir, name)
if os.path.exists(binpath):
return os.path.abspath(binpath)
return None
# Obtain the numpy include directory. This logic works across numpy versions.
try:
numpy_include = np.get_include()
except AttributeError:
numpy_include = np.get_numpy_include()
# run the customize_compiler
class custom_build_ext(build_ext):
def build_extensions(self):
build_ext.build_extensions(self)
ext_modules = [
Extension(
"utils.cython_bbox",
["utils/bbox.pyx"],
extra_compile_args={'gcc': ["-Wno-cpp", "-Wno-unused-function"]},
include_dirs = [numpy_include]
),
Extension(
"nms.cpu_nms",
["nms/cpu_nms.pyx"],
extra_compile_args={'gcc': ["-Wno-cpp", "-Wno-unused-function"]},
include_dirs = [numpy_include]
),
]
setup(
name='fast_rcnn',
ext_modules=ext_modules,
# inject our custom trigger
cmdclass={'build_ext': [custom_build_ext]},
)
I got this error -
python setup.py build_ext --inplace
running build_ext
skipping 'utils/bbox.c' Cython extension (up-to-date)
building 'utils.cython_bbox' extension
Traceback (most recent call last):
File "setup.py", line 149, in <module>
cmdclass={'build_ext': custom_build_ext},
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/Cython/Distutils/build_ext.py", line 163, in run
_build_ext.build_ext.run(self)
File "/usr/lib/python2.7/distutils/command/build_ext.py", line 337, in run
self.build_extensions()
File "setup.py", line 109, in build_extensions
build_ext.build_extensions(self)
File "/usr/lib/python2.7/dist-packages/Cython/Distutils/build_ext.py", line 171, in build_extensions
self.build_extension(ext)
File "/usr/lib/python2.7/distutils/command/build_ext.py", line 496, in build_extension
depends=ext.depends)
File "/usr/lib/python2.7/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/usr/lib/python2.7/distutils/unixccompiler.py", line 120, in _compile
extra_postargs)
TypeError: can only concatenate list (not "dict") to list
make: *** [all] Error 1
I can see that the error is being cause because I am supplying dict, but it is adding it to a list. Could you please help ?
how about changing the next-to-last line to
cmdclass={'build_ext': custom_build_ext}
extra_compile_args passed to compiler should be a list.
hello, have you solved this problem? would you please tell me how to solve it, thanks!
I am facing the same problem. Could you please explain?
I got the same error too.
Just change all extra_compile_args={'gcc': ["-Wno-cpp", "-Wno-unused-function"]}
to extra_compile_args=["-Wno-cpp", "-Wno-unused-function"]
.
I am trying to compile the GPU version and I get the same error. This is the complete trace:
building 'gpu_nms' extension
Traceback (most recent call last):
File "setup.py", line 148, in
have any of you found a solution or update to this ?
did you find a solution for that?