Bladeren bron

train YOLOX-S with AdamW

yjh0410 1 jaar geleden
bovenliggende
commit
d247f543ae
3 gewijzigde bestanden met toevoegingen van 11 en 11 verwijderingen
  1. 6 6
      config/model_config/yolox_config.py
  2. 1 1
      models/detectors/yolov5/README.md
  3. 4 4
      train.sh

+ 6 - 6
config/model_config/yolox_config.py

@@ -42,7 +42,7 @@ yolox_cfg = {
         'loss_cls_weight': 1.0,
         'loss_box_weight': 5.0,
         # ---------------- Train config ----------------
-        'trainer_type': 'yolox',
+        'trainer_type': 'rtcdet',
     },
 
     'yolox_t':{
@@ -85,7 +85,7 @@ yolox_cfg = {
         'loss_cls_weight': 1.0,
         'loss_box_weight': 5.0,
         # ---------------- Train config ----------------
-        'trainer_type': 'yolox',
+        'trainer_type': 'rtcdet',
     },
 
     'yolox_s':{
@@ -128,7 +128,7 @@ yolox_cfg = {
         'loss_cls_weight': 1.0,
         'loss_box_weight': 5.0,
         # ---------------- Train config ----------------
-        'trainer_type': 'yolox',
+        'trainer_type': 'rtcdet',
     },
 
     'yolox_m':{
@@ -171,7 +171,7 @@ yolox_cfg = {
         'loss_cls_weight': 1.0,
         'loss_box_weight': 5.0,
         # ---------------- Train config ----------------
-        'trainer_type': 'yolox',
+        'trainer_type': 'rtcdet',
     },
 
     'yolox_l':{
@@ -214,7 +214,7 @@ yolox_cfg = {
         'loss_cls_weight': 1.0,
         'loss_box_weight': 5.0,
         # ---------------- Train config ----------------
-        'trainer_type': 'yolox',
+        'trainer_type': 'rtcdet',
     },
 
     'yolox_x':{
@@ -257,7 +257,7 @@ yolox_cfg = {
         'loss_cls_weight': 1.0,
         'loss_box_weight': 5.0,
         # ---------------- Train config ----------------
-        'trainer_type': 'yolox',
+        'trainer_type': 'rtcdet',
     },
 
 }

+ 1 - 1
models/detectors/yolov5/README.md

@@ -20,7 +20,7 @@ On the other hand, we are trying to use **AdamW** and larger batch size to train
 |-----------|-------|-------|------------------------|-------------------|-------------------|--------------------|--------|
 | YOLOv5-N  | 8xb16 |  640  |                        |                   |                   |                    |  |
 | YOLOv5-T  | 8xb16 |  640  |                        |                   |                   |                    |  |
-| YOLOv5-S  | 8xb16 |  640  |                        |                   |                   |                    |  |
+| YOLOv5-S  | 8xb16 |  640  |         39.2           |        57.9       |        27.3       |         9.0        | [ckpt](https://github.com/yjh0410/RT-ODLab/releases/download/yolo_tutorial_ckpt/yolov5_s_coco_adamw.pth) |
 | YOLOv5-M  | 8xb16 |  640  |                        |                   |                   |                    |  |
 | YOLOv5-L  | 8xb16 |  640  |                        |                   |                   |                    |  |
 | YOLOv5-X  | 8xb16 |  640  |                        |                   |                   |                    |  |

+ 4 - 4
train.sh

@@ -4,9 +4,9 @@ DATA_ROOT="/data/datasets/"
 # DATA_ROOT="/Users/liuhaoran/Desktop/python_work/object-detection/dataset/"
 
 # MODEL setting
-MODEL="yolov5_s"
+MODEL="yolox_s"
 IMAGE_SIZE=640
-RESUME="weights/coco/yolov5_s/yolov5_s_best.pth"
+# RESUME="weights/coco/yolov5_s/yolov5_s_best.pth"
 if [[ $MODEL == *"yolov8"* ]]; then
     # Epoch setting
     BATCH_SIZE=128
@@ -23,11 +23,11 @@ elif [[ $MODEL == *"yolox2"* ]]; then
     NO_AUG_EPOCH=20
 elif [[ $MODEL == *"yolox"* ]]; then
     # Epoch setting
-    BATCH_SIZE=64
+    BATCH_SIZE=128
     MAX_EPOCH=300
     WP_EPOCH=3
     EVAL_EPOCH=10
-    NO_AUG_EPOCH=15
+    NO_AUG_EPOCH=20
 elif [[ $MODEL == *"yolov7"* ]]; then
     # Epoch setting
     BATCH_SIZE=128