This is a solution of 2018 Data Science Bowl rely on a forked version of multimodallearning's pytorch-mask-rcnn.
- Python 3.6
- Pytorch 0.3
- 8GB memory or better GPU
- Clone this repo.
git clone https://github.com/XingLiu14/dsb.git --recursive
- Download data by kaggle command.
kaggle competitions download -c data-science-bowl-2018
- Two more repositories that need to be build with the right
--arch
option for cuda support. The two functions are Non-Maximum Suppression from ruotianluo's pytorch-faster-rcnn repository and longcw's RoiAlign.
GPU | arch |
---|---|
TitanX | sm_52 |
GTX 960M | sm_50 |
GTX 1070 | sm_61 |
GTX 1080 (Ti) | sm_61 |
cd nms/src/cuda/
nvcc -c -o nms_kernel.cu.o nms_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]
cd ../../
python build.py
cp -R _ext dsb/pytorch-mask-rcnn/nms/_ext
cd roialign/roi_align/src/cuda/
nvcc -c -o crop_and_resize_kernel.cu.o crop_and_resize_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]
cd ../../
python build.py
cp -R _ext dsb/pytorch-mask-rcnn/roialign/roi_align/_ext
-
Download pretrained weights on COCO dataset
mask_rcnn_coco.pth
at https://drive.google.com/drive/folders/1LXUgC2IZUYNEoXr05tdqyKFZY0pZyPDc -
Using the following command to train the model
python dsb_train.py
- Tweak the configures in
dsb_config.py
, the learning rate and training strategy can be modified directly indsb_train.py
.
I don't have enough GPU resources to train this. I train this 2 epoch with coco pretrained model and I got 0.421 LB.