- Training
- Evaluation
- Export onnx
- Upload source code
- Upload weight convert from paddle, see links
- Align training details with the paddle version
- Tuning rtdetr based on pretrained weights
Install
pip install -r requirements.txt
Data
- Download and extract COCO 2017 train and val images.
path/to/coco/
annotations/ # annotation json files
train2017/ # train images
val2017/ # val images
- Modify config
img_folder
,ann_file
Training & Evaluation
- Training on a Single GPU:
# training on single-gpu
export CUDA_VISIBLE_DEVICES=0
python tools/train.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml
- Training on Multiple GPUs:
# train on multi-gpu
export CUDA_VISIBLE_DEVICES=0,1,2,3
torchrun --nproc_per_node=4 tools/train.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml
- Evaluation on Multiple GPUs:
# val on multi-gpu
export CUDA_VISIBLE_DEVICES=0,1,2,3
torchrun --nproc_per_node=4 tools/train.py -c configs/rtdetr/rtdetr_r50vd_6x_coco.yml -r path/to/checkpoint --test-only
Export
python tools/export_onnx.py -c configs/rtdetr/rtdetr_r18vd_6x_coco.yml -r path/to/checkpoint --check
Train custom data
-
set
remap_mscoco_category: False
. This variable only works for ms-coco dataset. -
add
-t path/to/checkpoint
(optinal) to tuning rtdetr based on pretrained checkpoint. see training script details.