Thank you for your great works! For me, it seems that the roi_align has been built successfully while neither roil_pooling nor nms does. The building information is listed as follows, could you help me?
congbaobao@congbaobao-Alienware-Aurora-R6:~/pytorch-faster-rcnn/lib$ bash make.sh
Compiling roi_pooling kernels by nvcc...
Including CUDA code.
/home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_pooling
generating /tmp/tmpl_9jnysz/_roi_pooling.c
setting the current directory to '/tmp/tmpl_9jnysz'
running build_ext
building '_roi_pooling' extension
creating home
creating home/congbaobao
creating home/congbaobao/pytorch-faster-rcnn
creating home/congbaobao/pytorch-faster-rcnn/lib
creating home/congbaobao/pytorch-faster-rcnn/lib/layer_utils
creating home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_pooling
creating home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_pooling/src
gcc -pthread -B /home/congbaobao/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/congbaobao/anaconda3/include/python3.6m -c _roi_pooling.c -o ./_roi_pooling.o
In file included from /home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THVector.h:5:0,
from /home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/TH.h:12,
from _roi_pooling.c:492:
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevl’:
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: note: use option -std=c99 or -std=gnu99 to compile your code
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevlf’:
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:142:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigamma’:
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:260:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigammaf’:
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:278:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
Traceback (most recent call last):
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command 'gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "build.py", line 34, in
ffi.build()
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/cffi/api.py", line 697, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/cffi/recompiler.py", line 1520, in recompile
compiler_verbose, debug)
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.error.VerificationError: CompileError: command 'gcc' failed with exit status 1
Compiling crop_and_resize kernels by nvcc...
Including CUDA code.
/home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align
generating /tmp/tmp4br1uvgc/_crop_and_resize.c
setting the current directory to '/tmp/tmp4br1uvgc'
running build_ext
building '_crop_and_resize' extension
creating home
creating home/congbaobao
creating home/congbaobao/pytorch-faster-rcnn
creating home/congbaobao/pytorch-faster-rcnn/lib
creating home/congbaobao/pytorch-faster-rcnn/lib/layer_utils
creating home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align
creating home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align/src
gcc -pthread -B /home/congbaobao/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/congbaobao/anaconda3/include/python3.6m -c _crop_and_resize.c -o ./_crop_and_resize.o -std=c99
gcc -pthread -B /home/congbaobao/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/congbaobao/anaconda3/include/python3.6m -c /home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align/src/crop_and_resize.c -o ./home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align/src/crop_and_resize.o -std=c99
/home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align/src/crop_and_resize.c: In function ‘CropAndResizePerBox’:
/home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align/src/crop_and_resize.c:30:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
#pragma omp parallel for
^
gcc -pthread -B /home/congbaobao/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/congbaobao/anaconda3/include/python3.6m -c /home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align/src/crop_and_resize_gpu.c -o ./home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align/src/crop_and_resize_gpu.o -std=c99
gcc -pthread -shared -B /home/congbaobao/anaconda3/compiler_compat -L/home/congbaobao/anaconda3/lib -Wl,-rpath=/home/congbaobao/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ ./_crop_and_resize.o ./home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align/src/crop_and_resize.o ./home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align/src/crop_and_resize_gpu.o /home/congbaobao/pytorch-faster-rcnn/lib/layer_utils/roi_align/src/cuda/crop_and_resize_kernel.cu.o -o ./_crop_and_resize.so
Compiling nms kernels by nvcc...
Including CUDA code.
/home/congbaobao/pytorch-faster-rcnn/lib/nms
generating /tmp/tmp4iss_v_h/_nms.c
setting the current directory to '/tmp/tmp4iss_v_h'
running build_ext
building '_nms' extension
creating home
creating home/congbaobao
creating home/congbaobao/pytorch-faster-rcnn
creating home/congbaobao/pytorch-faster-rcnn/lib
creating home/congbaobao/pytorch-faster-rcnn/lib/nms
creating home/congbaobao/pytorch-faster-rcnn/lib/nms/src
gcc -pthread -B /home/congbaobao/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/congbaobao/anaconda3/include/python3.6m -c _nms.c -o ./_nms.o
In file included from /home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THVector.h:5:0,
from /home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/TH.h:12,
from _nms.c:492:
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevl’:
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:134:3: note: use option -std=c99 or -std=gnu99 to compile your code
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_polevlf’:
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:142:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (size_t i = 0; i <= len; i++) {
^
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigamma’:
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:260:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h: In function ‘TH_trigammaf’:
/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH/THMath.h:278:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 6; ++i) {
^
Traceback (most recent call last):
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/congbaobao/anaconda3/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command 'gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "build.py", line 34, in
ffi.build()
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 184, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 108, in _build_extension
outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/cffi/api.py", line 697, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/cffi/recompiler.py", line 1520, in recompile
compiler_verbose, debug)
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/congbaobao/anaconda3/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.error.VerificationError: CompileError: command 'gcc' failed with exit status 1