yjh0410 hai 1 ano
pai
achega
ed2c4ac934

+ 1 - 1
odlab/models/detectors/__init__.py

@@ -21,7 +21,7 @@ def build_model(args, cfg, is_val=False):
     
     if is_val:
         # ------------ Keep training from the given weight ------------
-        if args.resume is not None:
+        if args.resume is not None and args.resume.lower() != "none":
             print('Load model from the checkpoint: ', args.resume)
             checkpoint = torch.load(args.resume, map_location='cpu')
             # checkpoint state dict

+ 6 - 6
odlab/models/detectors/fcos/README.md

@@ -3,12 +3,12 @@
 
 - COCO
 
-| Model          |  scale     |  FPS  | AP<sup>val<br>0.5:0.95 | AP<sup>val<br>0.5 | Weight | Logs  |
-| ---------------| ---------- | ----- | ---------------------- |  ---------------  | ------ | ----- |
-| FCOS_R18_1x    |  800,1333  |       |                    |               | [ckpt]() | [Logs]() |
-| FCOS_R50_1x    |  800,1333  |       |                    |                   | [ckpt]() | [Logs]() |
-| FCOS_RT_R18_3x |  512,736   |       |                    |                   | [ckpt]() | [Logs]() |
-| FCOS_RT_R50_3x |  512,736   |       |                    |                   | [ckpt]() | [Logs]() |
+| Model          |  scale     |  FPS<sup>FP32<br>RTX 4060  | AP<sup>val<br>0.5:0.95 | AP<sup>val<br>0.5 | Weight | Logs  |
+| ---------------| ---------- | -------------------------- | ---------------------- |  ---------------  | ------ | ----- |
+| FCOS_R18_1x    |  800,1333  |                          |                    |               | [ckpt]() | [Logs]() |
+| FCOS_R50_1x    |  800,1333  |                          |                    |               | [ckpt]() | [Logs]() |
+| FCOS_RT_R18_3x |  512,736   |                          |                    |               | [ckpt]() | [Logs]() |
+| FCOS_RT_R50_3x |  512,736   |                          |                    |               | [ckpt]() | [Logs]() |
 
 ## Train FCOS
 ### Single GPU

+ 5 - 2
odlab/train.sh

@@ -5,6 +5,7 @@ DATA_ROOT=$3
 BATCH_SIZE=$4
 WORLD_SIZE=$5
 MASTER_PORT=$6
+RESUME=$7
 
 # -------------------------- Train Pipeline --------------------------
 if [ $WORLD_SIZE == 1 ]; then
@@ -13,7 +14,8 @@ if [ $WORLD_SIZE == 1 ]; then
         --dataset ${DATASET}  \
         --root ${DATA_ROOT} \
         --model ${MODEL} \
-        --batch_size ${BATCH_SIZE}
+        --batch_size ${BATCH_SIZE} \
+        --resume ${RESUME}
 elif [[ $WORLD_SIZE -gt 1 && $WORLD_SIZE -le 8 ]]; then
     python -m torch.distributed.run --nproc_per_node=$WORLD_SIZE --master_port ${MASTER_PORT}  \
         train.py \
@@ -22,7 +24,8 @@ elif [[ $WORLD_SIZE -gt 1 && $WORLD_SIZE -le 8 ]]; then
         --dataset ${DATASET}  \
         --root ${DATA_ROOT} \
         --model ${MODEL} \
-        --batch_size ${BATCH_SIZE}
+        --batch_size ${BATCH_SIZE} \
+        --resume ${RESUME}
 else
     echo "The WORLD_SIZE is set to a value greater than 8, indicating the use of multi-machine \
           multi-card training mode, which is currently unsupported."

+ 1 - 1
odlab/utils/lr_scheduler.py

@@ -48,7 +48,7 @@ def build_lr_scheduler(cfg, optimizer, resume=None):
     elif cfg.lr_scheduler == 'cosine':
         pass
         
-    if resume is not None:
+    if resume is not None and resume.lower() != "none":
         print('Load lr scheduler from the checkpoint: ', resume)
         checkpoint = torch.load(resume)
         # checkpoint state dict

+ 1 - 1
odlab/utils/optimizer.py

@@ -34,7 +34,7 @@ def build_optimizer(cfg, model, resume=None):
             )
                                 
     start_epoch = 0
-    if resume is not None:
+    if resume is not None and resume.lower() != "none":
         print('Load optimzier from the checkpoint: ', resume)
         checkpoint = torch.load(resume)
         # checkpoint state dict