diff --git a/fedn/fedn/network/clients/client.py b/fedn/fedn/network/clients/client.py index 9afef9956..c8c4ac020 100644 --- a/fedn/fedn/network/clients/client.py +++ b/fedn/fedn/network/clients/client.py @@ -766,11 +766,11 @@ def run(self): old_state = self.state while True: time.sleep(1) - cnt += 1 + if cnt == 0: + logger.info("Client is active, waiting for model update requests.") + cnt = 1 if self.state != old_state: logger.info("Client in {} state.".format(ClientStateToString(self.state))) - if cnt > 5: - cnt = 0 if not self._attached: logger.info("Detached from combiner.") # TODO: Implement a check/condition to ulitmately close down if too many reattachment attepts have failed. s diff --git a/fedn/fedn/utils/dispatcher.py b/fedn/fedn/utils/dispatcher.py index 8b80a5e16..c7ace0ab5 100644 --- a/fedn/fedn/utils/dispatcher.py +++ b/fedn/fedn/utils/dispatcher.py @@ -1,3 +1,5 @@ +import os + from fedn.common.log_config import logger from fedn.utils.process import run_process @@ -32,7 +34,10 @@ def run_cmd(self, cmd_type): args = cmdsandargs[1:] # shell (this could be a venv, TODO: parametrize) - shell = ['/bin/sh', '-c'] + if os.name == "nt": + shell = [] + else: + shell = ['/bin/sh', '-c'] # add the corresponding process defined in project.yaml and append arguments from invoked command args = shell + [' '.join(cmd + args)] diff --git a/fedn/fedn/utils/plugins/kerashelper.py b/fedn/fedn/utils/plugins/kerashelper.py index 195858c76..7a931ae34 100644 --- a/fedn/fedn/utils/plugins/kerashelper.py +++ b/fedn/fedn/utils/plugins/kerashelper.py @@ -30,7 +30,7 @@ def increment_average(self, model, model_next, num_examples, total_examples): w = num_examples / total_examples weights = [] for i in range(len(model)): - weights.append(w * model[i] + (1 - w) * model_next[i]) + weights.append(w * model_next[i] + (1 - w) * model[i]) return weights