yichun

Results 6 comments of yichun

I solve the problem .You need to modify the code demo.py -- net.create_architecture("TEST", len(CLASSES), tag='default', anchor_scales=[8, 16, 32]), i change 21 to len(CLASSES),the demo.py can work.

Tanks,[https://doc.fedml.ai/federate/simulation/examples/sp_fedavg_mnist_lr_example](https://github.com/FedML-AI/FedML/issues/url)There is no file in this path anymore.The latest code I pulled directly from github ![image](https://github.com/FedML-AI/FedML/assets/41562415/16559083-fb03-47bc-9647-9c5035f552bd)

> 在flwr/server/server.py的代码里好像有地方可以修改,但是也需要改代码 是的,但是不知道怎么修改这个策略 ,现在我看都是一个固定值,没法和训练轮数挂钩。 我现在能想到的方法就是写两个模拟函数fl.simulation.start_simulation,比如前10epochs,客户端选择10个;后10个epochs训练再启动一个模拟函数,选择20个客户端,他的模型参数用第一次训练的参数。

> > > 在flwr/server/server.py的代码里好像有地方可以修改,但是也需要改代码 > > > > > > 是的,但是不知道怎么修改这个策略 ,现在我看都是一个固定值,没法和训练轮数挂钩。 我现在能想到的方法就是写两个模拟函数fl.simulation.start_simulation,比如前10epochs,客户端选择10个;后10个epochs训练再启动一个模拟函数,选择20个客户端,他的模型参数用第一次训练的参数。 > > 感觉你这个方法也可以,或者你可以试试把fraction_fit这个值从某个配置文件(比如/opt/fraction_fit.txt)中读取,然后在训练10轮以后修改/opt/fraction_fit.txt的内容,然后server.py再去读取这个内容?我不太确定server的启动是不是每轮都会重新分配一下,你可以试试 好的我试一试,我刚刚看到一个参数on_fit_config_fn ,感觉可能解决这个问题 ![image](https://github.com/adap/flower/assets/41562415/63b47579-27a0-4516-912d-4d8f1053428c) ![image](https://github.com/adap/flower/assets/41562415/87e7de98-4ceb-4cd9-8f7a-72ab990b19ce)

我研究联邦学习的客户端选择策略

> Hi, this can be done by overriding the `configure_fit` function of the strategy. E.g., > > ``` > def configure_fit( > self, server_round: int, parameters: Parameters, client_manager: ClientManager >...