Skip to content

Commit

Permalink
Fix quickstart-fastai example (#2111)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll authored Jul 13, 2023
1 parent 982e3fd commit 344c242
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/quickstart_fastai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 344c242

Please sign in to comment.