From e8b32a13fcea9a69e4e48d11e4036f0b816e9d51 Mon Sep 17 00:00:00 2001 From: "Eom, Jihwan" Date: Wed, 24 Aug 2022 18:53:27 +0900 Subject: [PATCH] Enhance code readability --- .../mpa_tasks/apis/classification/task.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/external/model-preparation-algorithm/mpa_tasks/apis/classification/task.py b/external/model-preparation-algorithm/mpa_tasks/apis/classification/task.py index 95276997ffc..615481a8d0a 100644 --- a/external/model-preparation-algorithm/mpa_tasks/apis/classification/task.py +++ b/external/model-preparation-algorithm/mpa_tasks/apis/classification/task.py @@ -305,8 +305,9 @@ def _init_model_cfg(self): if self._multilabel: template = MPAConfig.fromfile(self.template_file_path) template_params = template.hyper_parameters.parameter_overrides.learning_parameters - if cfg.get('runner', False) and (template_params.num_iters.default_value != self._hyperparams.learning_parameters.num_iters): - cfg.runner.max_epochs = self._hyperparams.learning_parameters.num_iters + incoming_params = self._hyperparams.learning_parameters + if cfg.get('runner', False) and (template_params.num_iters.default_value != incoming_params.num_iters): + cfg.runner.max_epochs = incoming_params.num_iters cfg.model.multilabel = self._multilabel cfg.model.hierarchical = self._hierarchical