flower icon indicating copy to clipboard operation
flower copied to clipboard

Issue with fraction_fit and min_available_clients in fl.server.strategy.FedAvg

Open DeltaRule opened this issue 4 years ago • 2 comments

I maybe wrong, or I'm not 100% sure how the fl.server.strategy.FedAvg (fraction_fit) works, but this ist my code : strategy = fl.server.strategy.FedAvg( fraction_fit = 1.0, fraction_eval = 1.0, min_available_clients = 10, eval_fn=get_eval_fn(model, testX, testY, idxList), on_evaluate_config_fn=evaluate_config, initial_parameters=fl.common.weights_to_parameters(model.get_weights()), ) This should mean I always use every client available or not? And the minimum of all Clients is 10 -> meaning I should use atleast 10 Clients for training. But thats not the case. DEBUG flower 2021-10-15 08:56:41,487 | server.py:255 | fit_round: strategy sampled 2 clients (out of 10) this is what I get. Am I just understanding fraction_fit wrong, or do I need to use min_fit_clients aswell.

I hope I'm not dumb. I know that even If this isn't a "bug" I'm just interested if I understood fraction_fit

DeltaRule avatar Oct 15 '21 07:10 DeltaRule

Hi @DeltaRule , your description of how fraction_fit should work is spot on.

The log output you're seeing shouldn't be possible. Could you perhaps share your code - or even better, a minimal reproduction of this error? Curious to look into it and see where this comes from.

danieljanes avatar Nov 23 '21 21:11 danieljanes

Ahhh I'm really sorry, but I don't have the code anymore, because I change the whole Concept of flwr to work for my Example. I ofc should have posted it directly. But if I remember correcltly I used https://github.com/adap/flower/tree/main/examples/advanced_tensorflow . As the base (just changed the FedAvg strategy to original post and the network and dataset). Also I used WSL Ubuntu 18.0.4. as the Operating System. I'm really sorry if you can't reproduce the Bug anymore. I'm also pretty sure I used Multiprocessing (the Libary) to spawn the 10 Clients. Everything was connecting to localhost.
I hope this helps.

DeltaRule avatar Nov 24 '21 08:11 DeltaRule