The Installation step is referenced from CenterNet.
Our experimental environment:
Ubuntu 16.04.1, Python 3.5.2, PyTorch 0.4.1, torchvision 0.2.1.
During training we use 8 NVIDIA TITAN XP with cuda 9.0.
-
Create a new conda environment and activate the environment.
conda create --name MOC python=3.5.2 conda activate MOC
-
Install pytorch0.4.1:
conda install pytorch=0.4.1 torchvision -c pytorch
Disable cudnn batch normalization(follow CenterNet).
# PYTORCH=/path/to/pytorch # usually ~/anaconda3/envs/MOC/lib/python3.5.2/site-packages/ # for pytorch v0.4.1 sed -i "1254s/torch\.backends\.cudnn\.enabled/False/g" ${PYTORCH}/torch/nn/functional.py
For other pytorch version, you can manually open
torch/nn/functional.py
and find the line withtorch.batch_norm
and replace thetorch.backends.cudnn.enabled
withFalse
. -
Clone this repo (${MOC_ROOT} is the path to clone):
git clone https://github.com/MCG-NJU/MOC-Detector.git ${MOC_ROOT}
-
Install the requirements
pip install -r pip-list.txt
-
Compile deformable convolutional in DLA backbone follow CenterNet.
cd ${MOC_ROOT}/src/network/DCNv2 bash make.sh