中文教程点这里
Original lab here
Already tested environment:
- Ubuntu 18.04
- Conda python3.7
- cuda 10.2
- nvidia rtx2080ti
- latest pytorch(1.2.1)
When tring to run code in 2080ti(cuda10.2,pytroch:1.2.1),I found that we can not run CenterNet in 2080ti directly with pytorch 0.4.x. I found some reference but there are some errors in them.I fix them.You can follow my steps as following or you can use the code directly.
Note: If you do not have conda , you should install conda first.
conda create --name CenterNet3.7 --python=3.7
conda activate CenterNet3.7
conda install pytorch torchvision -c pytorch
git clone https://github.com/xingyizhou/CenterNet
cd CenterNet/src
pip install -r requirements.txt
uncomment following code in CenterNet\src\lib\external\setup.py
#extra_compile_args=["-Wno-cpp", "-Wno-unused-function"]
cd CenterNet\src\lib\external
python setup.py install
python setup.py build_ext --inplace
uncomment following code in CenterNet\src\lib\models\networks\DCNv2\src\cuda\dcn_v2_cuda.cu
Steps:
cd CenterNet\src\lib\models\networks
rm -rf DCNv2
git clone https://github.com/CharlesShang/DCNv2
cd DCNv2
vim src/cuda/dcn_v2_cuda.cu
Then uncomment the following code:
//extern THCState *state;
THCState *state = at::globalContext().lazyInitCUDA();
python setup.py build develop
export COCOAPI=/path/to/clone/cocoapi
git clone https://github.com/cocodataset/cocoapi.git $COCOAPI
cd $COCOAPI/PythonAPI
make
python setup.py install --user