Mask_RCNN_Pytorch icon indicating copy to clipboard operation
Mask_RCNN_Pytorch copied to clipboard

Failed to build roi_align

Open hopstone opened this issue 6 years ago • 4 comments

(mrcnn) ubuntu@ubuntu-S2600IP:/develop/python/mrcnn/Mask_RCNN_Pytorch/roialign/roi_align$ python build.py Including CUDA code. /develop/python/mrcnn/Mask_RCNN_Pytorch/roialign/roi_align generating /tmp/tmpe3pzv2y7/_crop_and_resize.c setting the current directory to '/tmp/tmpe3pzv2y7' running build_ext building '_crop_and_resize' extension creating develop creating develop/python creating develop/python/mrcnn creating develop/python/mrcnn/Mask_RCNN_Pytorch creating develop/python/mrcnn/Mask_RCNN_Pytorch/roialign creating develop/python/mrcnn/Mask_RCNN_Pytorch/roialign/roi_align creating develop/python/mrcnn/Mask_RCNN_Pytorch/roialign/roi_align/src gcc -pthread -B /home/ubuntu/anaconda3/envs/mrcnn/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/ubuntu/anaconda3/envs/mrcnn/include/python3.6m -c _crop_and_resize.c -o ./_crop_and_resize.o -std=c99 -fopenmp -std=c99 gcc -pthread -B /home/ubuntu/anaconda3/envs/mrcnn/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/ubuntu/anaconda3/envs/mrcnn/include/python3.6m -c /develop/python/mrcnn/Mask_RCNN_Pytorch/roialign/roi_align/src/crop_and_resize.c -o ./develop/python/mrcnn/Mask_RCNN_Pytorch/roialign/roi_align/src/crop_and_resize.o -std=c99 -fopenmp -std=c99 /develop/python/mrcnn/Mask_RCNN_Pytorch/roialign/roi_align/src/crop_and_resize.c: In function ‘crop_and_resize_forward’: /develop/python/mrcnn/Mask_RCNN_Pytorch/roialign/roi_align/src/crop_and_resize.c:124:33: error: dereferencing pointer to incomplete type ‘THTensor {aka struct THTensor ’ const int batch_size = image->size[0]; ^ Traceback (most recent call last): File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile extra_postargs) File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/distutils/ccompiler.py", line 909, in spawn spawn(cmd, dry_run=self.dry_run) File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/distutils/spawn.py", line 36, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) File "/home/ubuntu/anaconda3/envs/mrcnn/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/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/cffi/ffiplatform.py", line 51, in _build dist.run_command('build_ext') File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension depends=ext.depends) File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/distutils/ccompiler.py", line 574, in compile self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) File "/home/ubuntu/anaconda3/envs/mrcnn/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 40, in ffi.build() File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 189, in build _build_extension(ffi, cffi_wrapper_name, target_dir, verbose) File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/torch/utils/ffi/init.py", line 111, in _build_extension outfile = ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname) File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/cffi/api.py", line 697, in compile compiler_verbose=verbose, debug=debug, **kwds) File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/cffi/recompiler.py", line 1520, in recompile compiler_verbose, debug) File "/home/ubuntu/anaconda3/envs/mrcnn/lib/python3.6/site-packages/cffi/ffiplatform.py", line 22, in compile outputfilename = _build(tmpdir, ext, compiler_verbose, debug) File "/home/ubuntu/anaconda3/envs/mrcnn/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 (mrcnn) ubuntu@ubuntu-S2600IP:/develop/python/mrcnn/Mask_RCNN_Pytorch/roialign/roi_align$

hopstone avatar Jan 28 '19 06:01 hopstone

Hi, I can build nms, but I can't build roi_align. I'm not sure where is the problem, please help me, thanks!

hopstone avatar Jan 29 '19 02:01 hopstone

Hi, I can build nms, but I can't build roi_align. I'm not sure where is the problem, please help me, thanks!

hi, have u solved the problem? I have encountered the same situation.

AIprogrammer avatar Mar 28 '19 17:03 AIprogrammer

Hi, I can build nms, but I can't build roi_align. I'm not sure where is the problem, please help me, thanks!

hi, have u solved the problem? I have encountered the same situation.

change the version of pytorch to 0.4.0 would work

AIprogrammer avatar Mar 31 '19 14:03 AIprogrammer

This is my environment"environment.yaml" to make success, I copy it out from linux. arch=sm_61
run"conda env create -f environment.yaml" `name: name channels:

  • pytorch
  • conda-forge
  • defaults dependencies:
  • backcall=0.1.0=py_0
  • ca-certificates=2019.6.16=hecc5488_0
  • certifi=2019.6.16=py36_1
  • cffi=1.12.3=py36h8022711_0
  • decorator=4.4.0=py_0
  • freetype=2.10.0=he983fc9_0
  • ipykernel=5.1.1=py36h5ca1d4c_0
  • ipython=7.6.1=py36h5ca1d4c_0
  • ipython_genutils=0.2.0=py_1
  • jedi=0.14.1=py36_0
  • jpeg=9c=h14c3975_1001
  • jupyter_client=5.3.1=py_0
  • jupyter_core=4.4.0=py_0
  • libblas=3.8.0=10_openblas
  • libcblas=3.8.0=10_openblas
  • libffi=3.2.1=he1b5a44_1006
  • liblapack=3.8.0=10_openblas
  • libopenblas=0.3.6=h6e990d7_4
  • libpng=1.6.37=hed695b0_0
  • libsodium=1.0.17=h516909a_0
  • libtiff=4.0.10=h57b8799_1003
  • lz4-c=1.8.3=he1b5a44_1001
  • ncurses=6.1=hf484d3e_1002
  • numpy=1.16.4=py36h95a1406_0
  • olefile=0.46=py_0
  • openblas=0.3.6=h6e990d7_4
  • openssl=1.1.1c=h516909a_0
  • parso=0.5.1=py_0
  • pexpect=4.7.0=py36_0
  • pickleshare=0.7.5=py36_1000
  • pillow=6.0.0=py36he7afcd5_0
  • pip=19.1.1=py36_0
  • prompt_toolkit=2.0.9=py_0
  • ptyprocess=0.6.0=py_1001
  • pycparser=2.19=py36_1
  • pygments=2.4.2=py_0
  • python=3.6.7=h357f687_1005
  • python-dateutil=2.8.0=py_0
  • pyzmq=18.0.2=py36hc4ba49a_1
  • readline=8.0=hf8c457e_0
  • setuptools=41.0.1=py36_0
  • six=1.12.0=py36_1000
  • sqlite=3.29.0=hcee41ef_0
  • tk=8.6.9=hed695b0_1002
  • tornado=6.0.3=py36h516909a_0
  • traitlets=4.3.2=py36_1000
  • wcwidth=0.1.7=py_1
  • wheel=0.33.4=py36_0
  • xz=5.2.4=h14c3975_1001
  • zeromq=4.3.2=he1b5a44_2
  • zlib=1.2.11=h14c3975_1004
  • zstd=1.4.0=h3b9ef0a_0
  • _libgcc_mutex=0.1=main
  • cudatoolkit=10.1.168=0
  • intel-openmp=2019.4=243
  • libgcc-ng=9.1.0=hdf63c60_0
  • libgfortran-ng=7.3.0=hdf63c60_0
  • libstdcxx-ng=9.1.0=hdf63c60_0
  • mkl=2019.4=243
  • cuda80=1.0=h205658b_0
  • pytorch=0.3.0=py36_cuda8.0.61_cudnn7.0.3h37a80b5_4`

77philosophia avatar Jul 26 '19 03:07 77philosophia