WwZzz / easyFL

An experimental platform for federated learning.
Apache License 2.0
519 stars 88 forks source link

module 'flgo.simulator' has no attribute 'base' #36

Closed hwyFighting closed 1 year ago

hwyFighting commented 1 year ago

你好,按照0_Quick_Start.ipynb执行的时候,在Start training with FedAvg部分报错如下,有什么解决方法吗?

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 fedavg_runner = flgo.init(task=task, algorithm=fedavg, option={'num_rounds':5, 'num_epochs':1, 'gpu':0})
      2 fedavg_runner.run()

File ~/miniconda3/lib/python3.8/site-packages/flgo/utils/fflow.py:482, in init(task, algorithm, option, model, Logger, Simulator, scene)
    480 gv.logger.info('Use `{}` as the system simulator'.format(str(Simulator)))
    481 # flgo.simulator.base.random_seed_gen = flgo.simulator.base.seed_generator(option['seed'])
--> 482 gv.clock = flgo.simulator.base.ElemClock()
    483 gv.simulator = Simulator(objects, option)
    484 gv.clock.register_simulator(simulator=gv.simulator)

AttributeError: module 'flgo.simulator' has no attribute 'base'
WwZzz commented 1 year ago

抱歉,我无法重复出你的报错。我新建了个虚拟环境,并分别尝试在jupyter notebook中直接粘贴quick_start中的代码,以及在IDE里用直接运行相同代码段,都没有出现报错。由于你给出的报错为找不到相应模块,我建议重新安装flgo包或许可以解决?

环境:Ubuntu 22.04.2 LTS, python3.10.9

注1:quick_start.ipynb中的安装命令没有及时更新,将安装旧的测试版本,现已修改安装语句并上传 注2:新、旧版本分别测试了相同代码段,均未出现报错

hwyFighting commented 1 year ago

抱歉,我无法重复出你的报错。我新建了个虚拟环境,并分别尝试在jupyter notebook中直接粘贴quick_start中的代码,以及在IDE里用直接运行相同代码段,都没有出现报错。由于你给出的报错为找不到相应模块,我建议重新安装flgo包或许可以解决?

环境:Ubuntu 22.04.2 LTS, python3.10.9

注1:quick_start.ipynb中的安装命令没有及时更新,将安装旧的测试版本,现已修改安装语句并上传 注2:新、旧版本分别测试了相同代码段,均未出现报错

感谢您的及时回复!通过重新创键虚拟环境,问题神奇地得到了解决😄