TsingZ0 / PFLlib

37 traditional FL (tFL) or personalized FL (pFL) algorithms, 3 scenarios, and 20 datasets.
GNU General Public License v2.0
1.35k stars 283 forks source link

agnews - dir alpha = 0.1时 运行FedALA出现错误 #165

Closed PaiStardian closed 6 months ago

PaiStardian commented 7 months ago

你好 ,Algorithm: FedALA Local batch size: 64 Local steps: 10 Local learing rate: 0.01 Local learing rate decay: False Total number of clients: 20 Clients join in each round: 1 Clients randomly join: False Client drop rate: 0.0 Client select regarding time: False Running times: 1 Dataset: agnews Number of classes: 4 Backbone: fastText Using device: cuda Using DP: False Auto break: False Global rounds: 500 Cuda device id: 0 DLG attack: False Total number of new clients: 0 Fine tuning epoches on new clients: 0 [这是我设置的参数然后再运行时报错,请问这种错误应该如何解决 1705415350774

TsingZ0 commented 7 months ago

请问你是修改过ALA.py吗?line 142目前是y = y.to(self.device)。建议使用最新的代码

PaiStardian commented 7 months ago

你好 我更新了最新的代码还是报如下的错误

PaiStardian commented 7 months ago

您可以验证一下 感谢

TsingZ0 commented 7 months ago

由于后来修改了dataset的划分方式,允许sample数量小于batch size大小,所以造成了这里的报错。

设置line 91rand_loader里的drop_last=False就好了