From 2d2585597db5c9e563bac2505e6121fea1acdbb2 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Thu, 13 Jul 2023 15:32:46 +0200 Subject: [PATCH] Fix quickstart-fastai example --- examples/quickstart_fastai/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/quickstart_fastai/client.py b/examples/quickstart_fastai/client.py index 6951eb091a6..a88abbe525d 100644 --- a/examples/quickstart_fastai/client.py +++ b/examples/quickstart_fastai/client.py @@ -14,7 +14,7 @@ # Load dataset dls = ImageDataLoaders.from_folder( - path, valid_pct=0.5, train="training", valid="testing" + path, valid_pct=0.5, train="training", valid="testing", num_workers=0 ) # Define model @@ -24,7 +24,7 @@ # Define Flower client class FlowerClient(fl.client.NumPyClient): def get_parameters(self, config): - return [val.numpy() for _, val in learn.model.state_dict().items()] + return [val.cpu().numpy() for _, val in learn.model.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(learn.model.state_dict().keys(), parameters)