Skip to content

Commit

Permalink
Fix mxnet quickstart example (#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll authored Jan 14, 2023
1 parent cc40177 commit d40a654
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/quickstart_mxnet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gz
4 changes: 2 additions & 2 deletions examples/quickstart_mxnet/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions examples/quickstart_mxnet/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ python = "^3.7"
flwr = "^0.17.0"
# flwr = { path = "../../", develop = true } # Development
mxnet = "^1.7.0"
numpy = "1.23.1"
2 changes: 1 addition & 1 deletion examples/quickstart_mxnet/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)

0 comments on commit d40a654

Please sign in to comment.