conansherry / detectron2

detectron2 windows build
Apache License 2.0
223 stars 54 forks source link

Error while installing detectron2 on Windows | Pytorch :1.5 | CUDA :10.1 #14

Closed veer5551 closed 4 years ago

veer5551 commented 4 years ago

If you do not know the root cause of the problem / bug, and wish someone to help you, please include:

How To Reproduce the Issue

  1. what changes you made (git diff) or what code you wrote No changes

  2. what exact command you run pip install -e . In the detectron2 directory as mentioned in this blog https://gilberttanner.com/blog/detectron-2-object-detection-with-pytorch

  3. what you observed (including the full logs):

    Running setup.py develop for detectron2
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\msjmf59\\Documents\\Projects\\Auto_Labelling\\Models\\Pytorch\\detectron2\\setup.py'"'"'; __file__='"'"'C:\\Users\\msjmf59\\Documents\\Projects\\Auto_Labelling\\Models\\Pytorch\\detectron2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: C:\Users\msjmf59\Documents\Projects\Auto_Labelling\Models\Pytorch\detectron2\
    Complete output (16 lines):
    running develop
    running egg_info
    writing detectron2.egg-info\PKG-INFO
    writing dependency_links to detectron2.egg-info\dependency_links.txt
    writing requirements to detectron2.egg-info\requires.txt
    writing top-level names to detectron2.egg-info\top_level.txt
    reading manifest file 'detectron2.egg-info\SOURCES.txt'
    writing manifest file 'detectron2.egg-info\SOURCES.txt'
    running build_ext
    building 'detectron2._C' extension
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWITH_CUDA -IC:\Users\msjmf59\Documents\Projects\Auto_Labelling\Models\Pytorch\detectron2\detectron2\layers\csrc -IC:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\lib\site-packages\torch\include -IC:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\lib\site-packages\torch\include\TH -IC:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -IC:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\include -IC:\Python37\include -IC:\Python37\include "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" -IC:\PROGRA~1\IBM\SQLLIB\INCLUDE -IC:\PROGRA~1\IBM\SQLLIB\LIB /EHsc /TpC:\Users\msjmf59\Documents\Projects\Auto_Labelling\Models\Pytorch\detectron2\detectron2\layers\csrc\vision.cpp /Fobuild\temp.win-amd64-3.7\Release\Users\msjmf59\Documents\Projects\Auto_Labelling\Models\Pytorch\detectron2\detectron2\layers\csrc\vision.obj /MD /wd4819 /EHsc -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
    vision.cpp
    C:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\lib\site-packages\torch\include\torch\csrc\api\include\torch/cuda.h(5): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory
    C:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\lib\site-packages\torch\utils\cpp_extension.py:304: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
      warnings.warn(msg.format('we could not find ninja.'))
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.11.25503\\bin\\HostX64\\x64\\cl.exe' failed with exit status 2
    ----------------------------------------
    ERROR: Command errored out with exit status 1: 'C:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\msjmf59\\Documents\\Projects\\Auto_Labelling\\Models\\Pytorch\\detectron2\\setup.py'"'"'; __file__='"'"'C:\\Users\\msjmf59\\Documents\\Projects\\Auto_Labelling\\Models\\Pytorch\\detectron2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

Environment

sys.platform            win32
Python                  3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)]
numpy                   1.18.4
detectron2              failed to import
detectron2._C           failed to import
DETECTRON2_ENV_MODULE   <not set>
PyTorch                 1.5.0+cu101 @C:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\lib\site-packages\torch
PyTorch debug build     False
CUDA available          True
GPU 0                   Quadro P1000
CUDA_HOME               C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
Pillow                  7.1.2
torchvision             0.6.0+cu101 @C:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\lib\site-packages\torchvision
torchvision arch flags  C:\Users\msjmf59\Documents\VirtualEnvironments\pytorch_gpu2\lib\site-packages\torchvision\_C.pyd; cannot find cuobjdump
fvcore                  0.1.1.post200513
cv2                     4.2.0
----------------------  -----------------------------------------------------------------------------------------------------------------------
PyTorch built with:
  - C++ Version: 199711
  - MSVC 191627039
  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191125 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v0.21.1 (Git Hash 7d2fd500bc78936d1d648ca713b901012f470dbc)
  - OpenMP 200203
  - CPU capability usage: AVX2
  - CUDA Runtime 10.1
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
  - CuDNN 7.6.4
  - Magma 2.5.2
  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS=/DWIN32 /D_WINDOWS  /GR  /w /EHa /bigobj -openmp -DNDEBUG -DUSE_FBGEMM, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF,
solarflarefx commented 4 years ago

@veer5551 any luck with this?

veer5551 commented 4 years ago

Please have a look at this https://github.com/conansherry/detectron2/issues/2 to resolve the issue

I will close this issue. Please reopen if you face any challenges while installing

Thanks @conansherry for this wonderful support!!

Thanks a lot!