From be71d268202e867730ad17b0db454d07201090a9 Mon Sep 17 00:00:00 2001 From: quzha Date: Mon, 12 Aug 2019 11:20:10 +0800 Subject: [PATCH 1/2] fix bug for duplicated final results --- src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py b/src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py index f66425d869..ac137256d5 100644 --- a/src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py +++ b/src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py @@ -315,6 +315,9 @@ def receive_trial_result(self, parameter_id, parameters, value, **kwargs): rval = self.CL_rval else: rval = self.rval + # ignore duplicated reported final result (due to aware of intermedate result) + if parameter_id not in self.running_data: + return self.running_data.remove(parameter_id) # update the reward of optimal_y From 36dac3994b6e7ced5b44be45d395d3d049c04fd3 Mon Sep 17 00:00:00 2001 From: quzha Date: Mon, 12 Aug 2019 11:23:37 +0800 Subject: [PATCH 2/2] add log --- src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py b/src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py index ac137256d5..a1c078bdd7 100644 --- a/src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py +++ b/src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py @@ -317,6 +317,7 @@ def receive_trial_result(self, parameter_id, parameters, value, **kwargs): rval = self.rval # ignore duplicated reported final result (due to aware of intermedate result) if parameter_id not in self.running_data: + logger.info("Received duplicated final result with parameter id: %s", parameter_id) return self.running_data.remove(parameter_id)