We used PyTorch 0.4.1 on Ubuntu 18.04 LTS with Anaconda Python 3.6.
-
[Optional but recommended] Create a new Conda environment.
conda create --name CircleNet python=3.6
And activate the environment.
conda activate CircleNet
-
Install Pytorch 0.4.1:
conda install pytorch=0.4.1 cuda92 torchvision -c pytorch
And disable cudnn batch normalization(Due to this issue).
# PYTORCH=/path/to/pytorch # usually ~/anaconda3/envs/CenterNet/lib/python3.6/site-packages/ # for pytorch v0.4.0 sed -i "1194s/torch\.backends\.cudnn\.enabled/False/g" ${PYTORCH}/torch/nn/functional.py # 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
. We observed slight worse training results without doing so. -
Install the requirements
pip install -r requirements.txt
-
Install COCOAPI:
COCOAPI=/path/to/clone/cocoapi git clone https://github.com/cocodataset/cocoapi.git $COCOAPI cd $COCOAPI/PythonAPI make python setup.py install --user
-
Clone this repo:
CircleNet_ROOT=/path/to/clone/CircleNet git clone https://github.com/hrlblab/CircleNet.git $CircleNet_ROOT
-
Compile deformable convolutional (from DCNv2).
cd $CircleNet_ROOT/src/lib/models/networks/DCNv2git ./make.sh
-
Compile NMS.
cd $CircleNet_ROOT/src/lib/external make