From 45259118ec1bb4c02368a8bcff36c42cab049356 Mon Sep 17 00:00:00 2001 From: charlesbvll Date: Fri, 13 Jan 2023 13:14:13 +0100 Subject: [PATCH 1/3] Fix num_rounds argument and downgrade Numpy --- examples/quickstart_mxnet/client.py | 4 ++-- examples/quickstart_mxnet/pyproject.toml | 1 + examples/quickstart_mxnet/server.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/quickstart_mxnet/client.py b/examples/quickstart_mxnet/client.py index 099572f7f3f..6c2b2e99775 100644 --- a/examples/quickstart_mxnet/client.py +++ b/examples/quickstart_mxnet/client.py @@ -38,7 +38,7 @@ def model(): # Flower Client class MNISTClient(fl.client.NumPyClient): - def get_parameters(self): + def get_parameters(self, config): param = [] for val in model.collect_params(".*weight").values(): p = val.data() @@ -54,7 +54,7 @@ def fit(self, parameters, config): self.set_parameters(parameters) [accuracy, loss], num_examples = train(model, train_data, epoch=2) results = {"accuracy": float(accuracy[1]), "loss": float(loss[1])} - return self.get_parameters(), num_examples, results + return self.get_parameters(config={}), num_examples, results def evaluate(self, parameters, config): self.set_parameters(parameters) diff --git a/examples/quickstart_mxnet/pyproject.toml b/examples/quickstart_mxnet/pyproject.toml index cf325466526..f1c494b9870 100644 --- a/examples/quickstart_mxnet/pyproject.toml +++ b/examples/quickstart_mxnet/pyproject.toml @@ -13,3 +13,4 @@ python = "^3.7" flwr = "^0.17.0" # flwr = { path = "../../", develop = true } # Development mxnet = "^1.7.0" +numpy = "1.23.1" diff --git a/examples/quickstart_mxnet/server.py b/examples/quickstart_mxnet/server.py index 204657694b5..871aa4e8ec9 100644 --- a/examples/quickstart_mxnet/server.py +++ b/examples/quickstart_mxnet/server.py @@ -5,5 +5,5 @@ if __name__ == "__main__": fl.server.start_server( server_address="0.0.0.0:8080", - config={"num_rounds": 3}, + config=fl.server.ServerConfig(num_rounds=3), ) From 308a187fb15797eb3ad4abffc7674e16a0ec664f Mon Sep 17 00:00:00 2001 From: charlesbvll Date: Fri, 13 Jan 2023 13:15:30 +0100 Subject: [PATCH 2/3] Add .gitignore to remove data files --- examples/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 examples/.gitignore diff --git a/examples/.gitignore b/examples/.gitignore new file mode 100644 index 00000000000..10d00b5797e --- /dev/null +++ b/examples/.gitignore @@ -0,0 +1 @@ +*.gz From 6474036651d70dd3a7cf7c2a193e4866f7722bfa Mon Sep 17 00:00:00 2001 From: charlesbvll Date: Fri, 13 Jan 2023 13:16:36 +0100 Subject: [PATCH 3/3] Move .gitignore to the correct location --- examples/{ => quickstart_mxnet}/.gitignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{ => quickstart_mxnet}/.gitignore (100%) diff --git a/examples/.gitignore b/examples/quickstart_mxnet/.gitignore similarity index 100% rename from examples/.gitignore rename to examples/quickstart_mxnet/.gitignore