Traceback (most recent call last):
File "D:\PFLlib-master\PFLlib-master\system\main.py", line 541, in <module>
run(args)
File "D:\PFLlib-master\PFLlib-master\system\main.py", line 373, in run
server.train()
File "D:\PFLlib-master\PFLlib-master\system\flcore\servers\serveravg.py", line 48, in train
self.evaluate()
File "D:\PFLlib-master\PFLlib-master\system\flcore\servers\serverbase.py", line 246, in evaluate
stats = self.test_metrics()
File "D:\PFLlib-master\PFLlib-master\system\flcore\servers\serverbase.py", line 220, in test_metrics
ct, ns, auc = c.test_metrics()
File "D:\PFLlib-master\PFLlib-master\system\flcore\clients\clientbase.py", line 125, in test_metrics
output = self.model(x)
File "E:\Anaconda3\envs\pfllib\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "D:\PFLlib-master\PFLlib-master\system\flcore\trainmodel\models.py", line 34, in forward
out = self.base(x)
File "E:\Anaconda3\envs\pfllib\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "D:\PFLlib-master\PFLlib-master\system\flcore\trainmodel\models.py", line 431, in forward
text, text_lengths = x
ValueError: too many values to unpack (expected 2)
感谢分享!这个仓库真的很好用!不过当我想使用这个框架察看
FedAvg
算法和lstm
模型在Shakespeare
数据集上的实验效果时,发现generate_Shakespeare.py
文件和generate_MNIST.py
文件有些区别,最终没能成功运行也找不出原因,不知如何是好,希望能得到一些建议!utils\data_utils.py
文件里的read_data()
方法报出找不到正确路径名的错误。通过调试,我发现最后
text, text_lengths = x
中x
的值为一个(10,80)大小的张量Tensor我的参数设置是这样的:
-data Shakespeare -m lstm -algo FedAvg -gr 2000 -did 0 -ls 5 -jr 0.1 -lr 1.47 -lbs 10
generate_Shakespeare.py
文件并不要求对non-iid, balance, partition等参数进行设置