From 75d29d16e953af12666c2a1e63f69bc83cc727aa Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Mon, 10 May 2021 17:30:08 +0800 Subject: [PATCH] refine lr schedule & download message (#2921) --- configs/ssd/_base_/optimizer_120e.yml | 2 +- ppdet/optimizer.py | 6 +++--- ppdet/utils/download.py | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/configs/ssd/_base_/optimizer_120e.yml b/configs/ssd/_base_/optimizer_120e.yml index 0625b6694..6fb65a906 100644 --- a/configs/ssd/_base_/optimizer_120e.yml +++ b/configs/ssd/_base_/optimizer_120e.yml @@ -5,7 +5,7 @@ LearningRate: schedulers: - !PiecewiseDecay milestones: [40, 60, 80, 100] - values: [0.001, 0.0005, 0.00025, 0.0001, 0.00001] + gamma: [0.5, 0.5, 0.4, 0.1] use_warmup: false OptimizerBuilder: diff --git a/ppdet/optimizer.py b/ppdet/optimizer.py index dc86023a6..0ffef2e99 100644 --- a/ppdet/optimizer.py +++ b/ppdet/optimizer.py @@ -113,9 +113,9 @@ class PiecewiseDecay(object): return optimizer.lr.PiecewiseDecay(boundary, self.values) # value is computed by self.gamma - if value is not None: - for i in self.gamma: - value.append(base_lr * i) + value = value if value is not None else [base_lr] + for i in self.gamma: + value.append(base_lr * i) return optimizer.lr.PiecewiseDecay(boundary, value) diff --git a/ppdet/utils/download.py b/ppdet/utils/download.py index 5075481cd..830026194 100644 --- a/ppdet/utils/download.py +++ b/ppdet/utils/download.py @@ -293,16 +293,16 @@ def _dataset_exists(path, annotation, image_dir): Check if user define dataset exists """ if not osp.exists(path): - logger.debug("Config dataset_dir {} is not exits, " - "dataset config is not valid".format(path)) + logger.warning("Config dataset_dir {} is not exits, " + "dataset config is not valid".format(path)) return False if annotation: annotation_path = osp.join(path, annotation) if not osp.isfile(annotation_path): - logger.debug("Config annotation {} is not a " - "file, dataset config is not " - "valid".format(annotation_path)) + logger.warning("Config annotation {} is not a " + "file, dataset config is not " + "valid".format(annotation_path)) return False if image_dir: image_path = osp.join(path, image_dir) -- GitLab