diff --git a/flaml/automl/automl.py b/flaml/automl/automl.py index 794bb17488b8..0990172c5d26 100644 --- a/flaml/automl/automl.py +++ b/flaml/automl/automl.py @@ -235,7 +235,7 @@ def update(self, result, time_used): n_iter = ( trained_estimator and hasattr(trained_estimator, "ITER_HP") - and trained_estimator.params[trained_estimator.ITER_HP] + and trained_estimator.params.get(trained_estimator.ITER_HP) ) if n_iter: config[trained_estimator.ITER_HP] = n_iter