Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building module external.nms failed: ["distutils.errors.CompileError: command 'gcc' failed with exit status 1\n"] #260

Open
Skye-Lin opened this issue Aug 9, 2019 · 1 comment

Comments

@Skye-Lin
Copy link

Skye-Lin commented Aug 9, 2019

I have been struggle with this quiet a long time...
When I run "python demo.py ctdet --demo webcam --load_model ../models/ctdet_coco_dla_2x.pth" as the author writed in the readme page, I got this problem.

`/home/skye/.pyxbld/temp.linux-x86_64-3.7/pyrex/external/nms.c:598:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
Traceback (most recent call last):
File "/home/skye/anaconda3/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/skye/anaconda3/lib/python3.7/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/skye/anaconda3/lib/python3.7/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/skye/anaconda3/lib/python3.7/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/skye/anaconda3/lib/python3.7/site-packages/pyximport/pyximport.py", line 215, in load_module
inplace=build_inplace, language_level=language_level)
File "/home/skye/anaconda3/lib/python3.7/site-packages/pyximport/pyximport.py", line 191, in build_module
reload_support=pyxargs.reload_support)
File "/home/skye/anaconda3/lib/python3.7/site-packages/pyximport/pyxbuild.py", line 102, in pyx_to_dll
dist.run_commands()
File "/home/skye/anaconda3/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/skye/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/skye/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "/home/skye/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/skye/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 194, in build_extensions
self.build_extension(ext)
File "/home/skye/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
depends=ext.depends)
File "/home/skye/anaconda3/lib/python3.7/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/skye/anaconda3/lib/python3.7/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 "centernet/src/demo.py", line 11, in
from detectors.detector_factory import detector_factory
File "/home/skye/centernet/src/lib/detectors/detector_factory.py", line 5, in
from .exdet import ExdetDetector
File "/home/skye/centernet/src/lib/detectors/exdet.py", line 18, in
from external.nms import soft_nms
File "/home/skye/anaconda3/lib/python3.7/site-packages/pyximport/pyximport.py", line 462, in load_module
language_level=self.language_level)
File "/home/skye/anaconda3/lib/python3.7/site-packages/pyximport/pyximport.py", line 231, in load_module
raise exc.with_traceback(tb)
File "/home/skye/anaconda3/lib/python3.7/site-packages/pyximport/pyximport.py", line 215, in load_module
inplace=build_inplace, language_level=language_level)
File "/home/skye/anaconda3/lib/python3.7/site-packages/pyximport/pyximport.py", line 191, in build_module
reload_support=pyxargs.reload_support)
File "/home/skye/anaconda3/lib/python3.7/site-packages/pyximport/pyxbuild.py", line 102, in pyx_to_dll
dist.run_commands()
File "/home/skye/anaconda3/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/skye/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/skye/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "/home/skye/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/skye/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 194, in build_extensions
self.build_extension(ext)
File "/home/skye/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
depends=ext.depends)
File "/home/skye/anaconda3/lib/python3.7/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/skye/anaconda3/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
ImportError: Building module external.nms failed: ["distutils.errors.CompileError: command 'gcc' failed with exit status 1\n"]`

I run this code in the google cloud platform. cuda9.0, python3.7.3,pytorch1.2.
Thank you for your solution.

@xingyizhou
Copy link
Owner

It seems numpy was not installed correctly. Make sure you are using anaconda. For the nms issue, you can comment out the import line. It is not used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants