Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mxnet quickstart example #1574

Merged
merged 6 commits into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
)