avatar

mmdetection window10安裝

mmdetection window10安裝

Install steps

1. 開新的conda environment

conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab

2. 安裝cudnn+cuda

Download cuDNN v7.6.3

Download cuda10

cuDNN載回來要把解壓縮的檔案都丟到剛剛安裝CUDA的資料夾(C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0)

cuda_folder

環境變數設定

接下來我們一樣進環境變數,在Path的地方新增兩個路徑

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp

environment path

這樣CUDA跟cuDNN就安裝完成了

3. 安裝pytorch

pytorch

conda install pytorch torchvision cudatoolkit=10.0 -c pytorch

詳細可以看官網有詳細每個作業系統及CUDA版本對應安裝指令

4. 安裝vs2017

Download vs2017

vs2017

環境變數設定

我的電腦->屬性->環境變數->高階系統設定->開啟Path,新增

D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\{版本號}\bin\HostX86\x86

environment path

新建Lib變數,新增三個路徑

變數名:LIB
變數值:D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\{版本號}\lib\x86;C:\Program Files (x86)\Windows Kits\10\Lib\{版本號}\ucrt\x86;C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86;

environment path

新建INCLUDE變數,新增兩個路徑:

變數名:INCLUDE
變數值:D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\{版本號}\include;C:\Program Files (x86)\Windows Kits\10\Include\{版本號}\ucrt;

進入D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build資料夾下,雙擊執行vcvarsall.bat檔案

驗證

Win+R->cmd開啟命令列,輸入cl,如下圖

verification

5. 安裝mmcv

pip install mmcv

6. 安裝mmdetection

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
python setup.py develop
# or "pip install -v -e ."

Reference

Compile successfully on Windows

Windows10下配置VS2017環境變數

[機器學習 ML NOTE] Windows 搭建Tensorflow-GPU 環境(Anaconda + Tensorflow-GPU+ CUDA+ cuDNN)

Author: Alen Chen
Link: https://alenweiru.gitlab.io/posts/c0ae7e4c/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.