0、首先創建文件夾。
a、mkdir detect
b、cd detect
1、安裝conda。
a、./Anaconda3-2019.10-Linux-x86_64.sh
2、創建並激活CenterNet環境。
a、conda create --name CenterNet python=3.7
b、conda activate CenterNet
3、安裝pytorch。
a、conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
4、安裝CocoAPI。
a、git clone https://github.com/cocodataset/cocoapi.git
b、cd PythonAPI
c、make
出現錯誤:“gcc: error: pycocotools/_mask.c: No such file or directory”
解決方法:pip install cython
d、python setup.py install --user
5、安裝CenterNet和其他依賴。
a、cd ../..
b、git clone https://github.com/xingyizhou/CenterNet
c、cd CenterNet
d、pip install -r requirements.txt
6、編譯DCNV2。
a、cd src/lib/models/networks/DCNv2
b、./make.sh
出現錯誤:“ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.”
解決方法:cd ..
mv DCNv2/ DCNv2_old/
git clone https://github.com/CharlesShang/DCNv2.git
cd DCNv2
./make.sh
7、編譯NMS。
a、cd ../../../external
b、make