diff --git a/external/anomaly/tests/test_ote_training.py b/external/anomaly/tests/test_ote_training.py index f868eb812e5..7db6b88ed1e 100644 --- a/external/anomaly/tests/test_ote_training.py +++ b/external/anomaly/tests/test_ote_training.py @@ -214,7 +214,7 @@ def _run_ote_training(self, data_collector): logger.debug("Set hyperparameters") params = ote_sdk_configuration_helper_create(self.model_template.hyper_parameters.data) - if hasattr(params, "model"): + if hasattr(params, "model") and hasattr(params.model, "early_stopping"): if self.num_training_iters != KEEP_CONFIG_FIELD_VALUE: params.model.early_stopping.patience = int(self.num_training_iters) logger.debug(f"Set params.model.early_stopping.patience=" f"{params.model.early_stopping.patience}")