VS2019_Community
python-3.6.0-amd64
Anaconda3-2020.11-Windows-x86_64
pycharm-community-2020.3.5
cuda_10.2.89_441.22_win10
cudnn-10.2-windows10-x64-v7.6.5.32
1.安装cuda
安装完cuda后,配置环境变量
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib\x64
2.设置cl.exe环境变量
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\Hostx64\x64
然后,进入cmd,输入cl
3.下载依赖包
以管理员方式打开Anaconda Prompt (Anaconda3)
创建并激活conda环境
conda create -n detectron2_test python=3.6
conda activate detectron2_test
4.安装Cython等
pip install cython pyyaml tabulate termcolor yacs iopath ninja
pip install opencv-python
pip install omegaconf==2.1.0.dev22
pip install cloudpickle
pip install Matplotlib
pip install pydot
pip install tensorboard
pip install pycocotools>=2.0.2
5.安装torch,torchvision
下载地址:https://download.pytorch.org/whl/torch_stable.html
cd到下载路径。cd D:\detectron2-test
pip install torch-1.6.0-cp36-cp36m-win_amd64.whl
pip install torchvision-0.7.0-cp36-cp36m-win_amd64.whl
如果提示让更新pip,最好更新下
python -m pip install --upgrade pip
6.安装cocoapi
下载地址:https://github.com/philferriere/cocoapi
cd到下载路径。cd D:\detectron2-test\cocoapi-master\PythonAPI
python setup.py build_ext --inplace
python setup.py build_ext install
7.安装fvcore
下载地址:https://github.com/facebookresearch/fvcore
cd到下载路径。cd D:\detectron2-test\fvcore-master
python setup.py build --force develop
8.安装detectron2
下载地址:https://github.com/facebookresearch/detectron2
cd到下载路径。cd D:\detectron2-test\detectron2-master
python setup.py build --force develop
9.图像识别
demo.py