1

我正在尝试从 pysyft 运行联合学习(https://github.com/OpenMined/PySyft/blob/dev/examples/tutorials/advanced/websockets-example-MNIST-parallel/Asynchronous-federated-learning-on-MNIST .ipynb)创建远程工作人员并通过 websockets 连接到他们。但是我在执行评估步骤时遇到错误。

future: <Task finished coro=<WebsocketServerWorker._producer_handler() done, defined at C:\Users\Public\Anaconda\lib\site-packages\syft\workers\websocket_server.py:95> exception=AttributeError("'dict' object has no attribute 'owner'")>
Traceback (most recent call last):
  File "C:\Users\Public\Anaconda\lib\site-packages\syft\generic\frameworks\hook\hook_args.py", line 663, in register_response
    register_response_function = register_response_functions[attr_id]
KeyError: 'evaluate'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Public\Anaconda\lib\site-packages\syft\workers\websocket_server.py", line 113, in _producer_handler
    response = self._recv_msg(message)
  File "C:\Users\Public\Anaconda\lib\site-packages\syft\workers\websocket_server.py", line 124, in _recv_msg
    return self.recv_msg(message)
  File "C:\Users\Public\Anaconda\lib\site-packages\syft\workers\base.py", line 310, in recv_msg
    response = self._message_router[type(msg)](msg.contents)
  File "C:\Users\Public\Anaconda\lib\site-packages\syft\workers\base.py", line 457, in execute_command
    command_name, response, list(return_ids), self
  File "C:\Users\Public\Anaconda\lib\site-packages\syft\generic\frameworks\hook\hook_args.py", line 672, in register_response
    new_response = register_response_function(response, response_ids=response_ids, owner=owner)
  File "C:\Users\Public\Anaconda\lib\site-packages\syft\generic\frameworks\hook\hook_args.py", line 766, in <lambda>
    return lambda x, **kwargs: f(lambdas, x, **kwargs)
  File "C:\Users\Public\Anaconda\lib\site-packages\syft\generic\frameworks\hook\hook_args.py", line 522, in two_fold
    return lambdas[0](args[0], **kwargs), lambdas[1](args[1], **kwargs)
  File "C:\Users\Public\Anaconda\lib\site-packages\syft\generic\frameworks\hook\hook_args.py", line 744, in <lambda>
    else lambda i, **kwargs: register_tensor(i, **kwargs)
  File "C:\Users\Public\Anaconda\lib\site-packages\syft\generic\frameworks\hook\hook_args.py", line 712, in register_tensor
    tensor.owner = owner
AttributeError: 'dict' object has no attribute 'owner'

他们的论坛没有明确的答案。有没有人知道这个脚本中的问题是什么。

我的 syft 版本:

syft : 0.2.3a1
syft-proto : 0.1.1a1.post12
torch : 1.4.0
4

1 回答 1

1

我也遇到了这个问题,并在https://github.com/OpenMined/PySyft/pull/2948中进行了修复

于 2020-02-19T02:38:33.723 回答