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

Successfully installed detectron2 on Win10 #19

Open
Einstone-rose opened this issue Aug 17, 2020 · 6 comments
Open

Successfully installed detectron2 on Win10 #19

Einstone-rose opened this issue Aug 17, 2020 · 6 comments

Comments

@Einstone-rose
Copy link

Einstone-rose commented Aug 17, 2020

Requirements:

  • Python 3.6.1
  • Pytorch 1.4.0
  • torchvision 0.5
  • fvcore: pip install git+https://github.com/facebookresearch/fvcore
  • pycocotools: pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
  • VS2019/CUDA10.1

Procedures

  • Step1: git clone https://github.com/conansherry/detectron2.git
  • Step2: pip install -e detectron2

I have installed many times, sometimes it doesn't work and somtimes it works. The following is installation log:

Step1:
PS C:\Users\einst> pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

Collecting git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
Cloning https://github.com/philferriere/cocoapi.git to c:\users\einst\appdata\local\temp\pip-req-build-z9ylc7pb
Running command git clone -q https://github.com/philferriere/cocoapi.git 'C:\Users\einst\AppData\Local\Temp\pip-req-build-z9ylc7pb'
Requirement already satisfied (use --upgrade to upgrade): pycocotools==2.0 from git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI in d:\anaconda3\lib\site-packages
Building wheels for collected packages: pycocotools
Building wheel for pycocotools (setup.py) ... done
Created wheel for pycocotools: filename=pycocotools-2.0-cp36-cp36m-win_amd64.whl size=82369 sha256=4ed441ff898d3719cbf3a99b60123c3ef4a7b76811811a3a5851b8a558022d75
Stored in directory: C:\Users\einst\AppData\Local\Temp\pip-ephem-wheel-cache-2xuc_q_m\wheels\b9\4e\44\7b76fc7329ff952a523b8b7dfa674a02b71ae92de8f4eb96a6
Successfully built pycocotools

Step2:
PS D:\Pytorch Project> pip install -e detectron2

Obtaining file:///D:/Pytorch%20Project/detectron2
Requirement already satisfied: termcolor>=1.1 in d:\anaconda3\lib\site-packages (from detectron2==0.1) (1.1.0)
Requirement already satisfied: Pillow>=6.0 in d:\anaconda3\lib\site-packages (from detectron2==0.1) (7.1.2)
Requirement already satisfied: yacs>=0.1.6 in d:\anaconda3\lib\site-packages (from detectron2==0.1) (0.1.7)
Requirement already satisfied: tabulate in d:\anaconda3\lib\site-packages (from detectron2==0.1) (0.8.7)
Requirement already satisfied: cloudpickle in d:\anaconda3\lib\site-packages (from detectron2==0.1) (0.2.2)
Requirement already satisfied: matplotlib in d:\anaconda3\lib\site-packages (from detectron2==0.1) (2.0.2)
Requirement already satisfied: tqdm>4.29.0 in d:\anaconda3\lib\site-packages (from detectron2==0.1) (4.45.0)
Requirement already satisfied: tensorboard in d:\anaconda3\lib\site-packages (from detectron2==0.1) (2.2.1)
Requirement already satisfied: imagesize in d:\anaconda3\lib\site-packages (from detectron2==0.1) (0.7.1)
Requirement already satisfied: PyYAML in d:\anaconda3\lib\site-packages (from yacs>=0.1.6->detectron2==0.1) (5.3.1)
Requirement already satisfied: numpy>=1.7.1 in d:\anaconda3\lib\site-packages (from matplotlib->detectron2==0.1) (1.12.1)
Requirement already satisfied: six>=1.10 in d:\anaconda3\lib\site-packages (from matplotlib->detectron2==0.1) (1.10.0)
Requirement already satisfied: python-dateutil in d:\anaconda3\lib\site-packages (from matplotlib->detectron2==0.1) (2.6.0)
Requirement already satisfied: pytz in d:\anaconda3\lib\site-packages (from matplotlib->detectron2==0.1) (2017.2)
Requirement already satisfied: cycler>=0.10 in d:\anaconda3\lib\site-packages (from matplotlib->detectron2==0.1) (0.10.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in d:\anaconda3\lib\site-packages (from matplotlib->detectron2==0.1) (2.1.4)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (0.4.1)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (1.6.0.post3)
Requirement already satisfied: requests<3,>=2.21.0 in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (2.23.0)
Requirement already satisfied: setuptools>=41.0.0 in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (46.1.3)
Requirement already satisfied: markdown>=2.6.8 in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (3.2.1)
Requirement already satisfied: grpcio>=1.24.3 in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (1.28.1)
Requirement already satisfied: absl-py>=0.4 in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (0.9.0)
Requirement already satisfied: protobuf>=3.6.0 in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (3.11.3)
Requirement already satisfied: werkzeug>=0.11.15 in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (0.12.2)
Requirement already satisfied: wheel>=0.26; python_version >= "3" in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (0.29.0)
Requirement already satisfied: google-auth<2,>=1.6.3 in d:\anaconda3\lib\site-packages (from tensorboard->detectron2==0.1) (1.14.1)
Requirement already satisfied: requests-oauthlib>=0.7.0 in d:\anaconda3\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard->detectron2==0.1) (1.3.0)
Requirement already satisfied: certifi>=2017.4.17 in d:\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.1) (2020.4.5.1)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in d:\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.1) (1.25.9)
Requirement already satisfied: idna<3,>=2.5 in d:\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.1) (2.5)
Requirement already satisfied: chardet<4,>=3.0.2 in d:\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.1) (3.0.3)
Requirement already satisfied: pyasn1-modules>=0.2.1 in d:\anaconda3\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard->detectron2==0.1) (0.2.8)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in d:\anaconda3\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard->detectron2==0.1) (4.1.0)
Requirement already satisfied: rsa<4.1,>=3.1.4 in d:\anaconda3\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard->detectron2==0.1) (4.0)
Requirement already satisfied: oauthlib>=3.0.0 in d:\anaconda3\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard->detectron2==0.1) (3.1.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in d:\anaconda3\lib\site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard->detectron2==0.1) (0.4.8)
Installing collected packages: detectron2
Running setup.py develop for detectron2
Successfully installed detectron2

@xitox97
Copy link

xitox97 commented Aug 19, 2020

Thank you, works for me also. But in my case before install pycocotools, I need to install cython first.

@Tomiha
Copy link

Tomiha commented Sep 9, 2020

No idea what I'm doing wrong, but can't get detectron2 to compile...
What exact compiler version are you using?

@mbhoshen
Copy link

I end with
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe -c C:\Users\moshe\detectron2\detectron2\detectron2\layers\csrc\box_iou_rotated\box_iou_rotated_cuda.cu -o build\temp.win-amd64-3.8\Release\Users\moshe\detectron2\detectron2\detectron2\layers\csrc\box_iou_rotated\box_iou_rotated_cuda.obj -IC:\Users\moshe\detectron2\detectron2\detectron2\layers\csrc -IC:\ProgramData\Anaconda3\envs\detectron\lib\site-packages\torch\include -IC:\ProgramData\Anaconda3\envs\detectron\lib\site-packages\torch\include\torch\csrc\api\include -IC:\ProgramData\Anaconda3\envs\detectron\lib\site-packages\torch\include\TH -IC:\ProgramData\Anaconda3\envs\detectron\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -IC:\ProgramData\Anaconda3\envs\detectron\include -IC:\ProgramData\Anaconda3\envs\detectron\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" -Xcompiler /EHsc -Xcompiler /wd4819 -Xcompiler /MD -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61
nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/HostX86/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat'
error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\ProgramData\Anaconda3\envs\detectron\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\moshe\detectron2\detectron2\setup.py'"'"'; file='"'"'C:\Users\moshe\detectron2\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.

Any ideas? I have tried again and again

@vvgoder
Copy link

vvgoder commented Oct 23, 2020

I end with
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe -c C:\Users\moshe\detectron2\detectron2\detectron2\layers\csrc\box_iou_rotated\box_iou_rotated_cuda.cu -o build\temp.win-amd64-3.8\Release\Users\moshe\detectron2\detectron2\detectron2\layers\csrc\box_iou_rotated\box_iou_rotated_cuda.obj -IC:\Users\moshe\detectron2\detectron2\detectron2\layers\csrc -IC:\ProgramData\Anaconda3\envs\detectron\lib\site-packages\torch\include -IC:\ProgramData\Anaconda3\envs\detectron\lib\site-packages\torch\include\torch\csrc\api\include -IC:\ProgramData\Anaconda3\envs\detectron\lib\site-packages\torch\include\TH -IC:\ProgramData\Anaconda3\envs\detectron\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -IC:\ProgramData\Anaconda3\envs\detectron\include -IC:\ProgramData\Anaconda3\envs\detectron\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" -Xcompiler /EHsc -Xcompiler /wd4819 -Xcompiler /MD -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61
nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/HostX86/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat'
error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe' failed with exit status 1

ERROR: Command errored out with exit status 1: 'C:\ProgramData\Anaconda3\envs\detectron\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\moshe\detectron2\detectron2\setup.py'"'"'; file='"'"'C:\Users\moshe\detectron2\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.

Any ideas? I have tried again and again

I have the same problem with you, Have you solved it?

@tunai
Copy link

tunai commented Nov 3, 2020

Hi all,

I've put together a tutorial on how to install Detectron2 using conansherry's build. Maybe it can prove to be helpful to you.

@3265
Copy link

3265 commented Dec 6, 2020

@tunai Ultra thanks! I could install the detectron 2 on my Windows PC by using your tutorial.

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

7 participants