yjh0410 il y a 1 an
Parent
commit
f8eb52e694
4 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 1 1
      odlab/models/detectors/yolof/README.md
  2. 1 1
      odlab/train.py
  3. 1 1
      odlab/utils/optimizer.py
  4. 2 2
      yolo/engine.py

+ 1 - 1
odlab/models/detectors/yolof/README.md

@@ -5,7 +5,7 @@
 | Model            |  scale     |  FPS<sup>FP32<br>RTX 4060  | AP<sup>val<br>0.5:0.95 | AP<sup>val<br>0.5 | Weight | Logs  |
 | ---------------- | ---------- | ---------------------- | ---------------------- |  ---------------  | ------ | ----- |
 | YOLOF_R18_C5_1x  |  800,1333  |           54           |          32.8          |       51.4        | [ckpt](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/yolof_r18_c5_1x_coco.pth) | [log](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/YOLOF-R18-C5-1x.txt) |
-| YOLOF_R50_C5_1x  |  800,1333  |       |                    |               |  |  |
+| YOLOF_R50_C5_1x  |  800,1333  |           21           |          37.7          |       57.2        | [ckpt](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/yolof_r50_c5_1x_coco.pth) | [log](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/YOLOF-R50-C5-1x.txt) |
 
 
 ## Train YOLOF

+ 1 - 1
odlab/train.py

@@ -204,7 +204,7 @@ def main():
                     torch.save({'model':        model_eval.state_dict(),
                                 'optimizer':    optimizer.state_dict(),
                                 'lr_scheduler': lr_scheduler.state_dict(),
-                                'mAP':          round(best_map*100, 1),
+                                'mAP':          round(best_map*100, 3),
                                 'epoch':        epoch,
                                 'args':         args}, 
                                 os.path.join(path_to_save, '{}_best.pth'.format(args.model)))

+ 1 - 1
odlab/utils/optimizer.py

@@ -45,7 +45,7 @@ def build_optimizer(cfg, model, resume=None):
         if "mAP" in checkpoint:
             print('--Load best metric from the checkpoint: ', resume)
             best_map = checkpoint["mAP"]
-            cfg.best_map = best_map
+            cfg.best_map = best_map / 100.0
         del checkpoint, checkpoint_state_dict
                                                         
     return optimizer, start_epoch

+ 2 - 2
yolo/engine.py

@@ -72,7 +72,7 @@ class YoloTrainer(object):
         self.lr_scheduler_warmup = LinearWarmUpLrScheduler(warmup_iters, cfg.base_lr, cfg.warmup_bias_lr)
         self.lr_scheduler = build_lr_scheduler(cfg, self.optimizer, args.resume)
 
-        self.best_map = cfg.best_map
+        self.best_map = cfg.best_map / 100.0
         print("Best mAP metric: {}".format(self.best_map))
 
     def train(self, model):
@@ -147,7 +147,7 @@ class YoloTrainer(object):
                 checkpoint_path = os.path.join(self.path_to_save, weight_name)
                 state_dicts = {
                     'model': model_eval.state_dict(),
-                    'mAP': round(cur_map*100, 1),
+                    'mAP': round(cur_map*100, 3),
                     'optimizer':  self.optimizer.state_dict(),
                     'lr_scheduler': self.lr_scheduler.state_dict(),
                     'epoch': self.epoch,