facebookresearch / Detectron

FAIR's research platform for object detection research, implementing popular algorithms like Mask R-CNN and RetinaNet.
Apache License 2.0
26.27k stars 5.45k forks source link

Command line error D8021 : invalid numeric argument '/Wno-cpp' #552

Closed aw236 closed 6 years ago

aw236 commented 6 years ago

I am trying to install Detectron on my Windows 10 PC with a GTX 1070.

I followed the directions.

DETECTRON=/path/to/clone/detectron

  1. git clone https://github.com/facebookresearch/detectron $DETECTRON
  2. pip install -r $DETECTRON/requirements.txt
  3. cd $DETECTRON && make

on the make step, I get the following error:

C:\Users\andcy\$DETECTRON>make
python setup.py develop --user
running develop
running egg_info
writing Detectron.egg-info\PKG-INFO
writing top-level names to Detectron.egg-info\top_level.txt
writing dependency_links to Detectron.egg-info\dependency_links.txt
reading manifest file 'Detectron.egg-info\SOURCES.txt'
writing manifest file 'Detectron.egg-info\SOURCES.txt'
running build_ext
building 'detectron.utils.cython_bbox' extension
C:\Users\andcy\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\andcy\AppData\Local\Continuum\anaconda2\lib\site-packages\numpy\core\include -IC:\Users\andcy\AppData\Local\Continuum\anaconda2\include -IC:\Users\andcy\AppData\Local\Continuum\anaconda2\PC /Tcdetectron/utils/cython_bbox.c /Fobuild\temp.win-amd64-2.7\Release\detectron/utils/cython_bbox.obj -Wno-cpp
cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'
error: command 'C:\\Users\\andcy\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
make: *** [dev] Error 1

I searched the Internet for: cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'.

I found a number of solutions:

  1. https://github.com/CharlesShang/FastMaskRCNN/issues/173
  2. https://github.com/cocodataset/cocoapi/issues/51

The solution being:

First go to cocoapi\PythonAPI\setup.py and change a line from from: extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'], to extra_compile_args={'gcc': ['/Qstd=c99']},

It did not work because of TypeError: can only concatenate list (not "dict") to list make:.

Further down in the comments, @TonyNgo1 mentions that he also gets the error and suggests removing the line entirely. It works.

However, I am still unable to make Detectron.

Any ideas or references?

2227 Warning(s)
0 Error(s)

Time Elapsed 00:05:28.53 "Caffe2 built successfully"

ir413 commented 6 years ago

Hi @aw236, we do not provide support for building on Windows at this time (see #454, #276 and #25 for discussions that may be helpful). Sorry for the inconvenience.

gcrookie commented 6 years ago

extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'], to extra_compile_args={'gcc': ['/Qstd=c99']},

This worked for me on Windows

liqi198786 commented 4 years ago

@aw236 , hi , have you solved the problem? i encountered the same situation.