PySyft icon indicating copy to clipboard operation
PySyft copied to clipboard

Error when launching the federated-learning exemple mcfl_create_plan : host_federated_training generate "Expecting value: line 1 column 1 (char 0)"

Open Macha2021 opened this issue 3 years ago • 6 comments

Description

When I launch the exemple notebook mcfl_create_plan, I found an error when launching the process.

How to Reproduce

  1. Launch the fllowing script server.py:

federated1

  1. Launch the jupyter notebook: examples/federated-learning/model-centric/mcfl_create_plan.ipynb

Screenshots

I obtained the following error:

response1 (3) response2

The 4th part of the JSON file seems to be empty, but I cannot find why the message is divided in 4 parts. Does someone found the same error ?

System Information

  • OS: Windows
  • OS Version: 10
  • Language Version: Python 3.7
  • Browser: Edge

Macha2021 avatar Apr 29 '21 08:04 Macha2021

Hi, have you solved this issue? I met the same problem here, but it returns BrokenPipeError: [Errno 32] Broken pipe. The full screenshot is like this:

2021-05-02 18-15-13 的屏幕截图

I googled this error online, but this error usually caused by torch.DataLoader which is not related to my issue. I think this may be caused by socket service closed, but I don't know why the PyGrid socket is disconnected. The screenshot of the terminal is like this:

2021-05-02 18-32-17 的屏幕截图

Appreciate if you know how to fix this.


And as for this error you met, this may because the json.loads(self.ws.recv()), you can try to add this argument json.loads(self.ws.recv(), strict=False) to see if your problem resolved. Hope this can help you.

LaplaceZhang avatar May 02 '21 17:05 LaplaceZhang

Since I still have issues on windows, I have tried this script on ubuntu docker container and I found the same error as your. Did you found a solution to this problem?

Macha2021 avatar May 12 '21 15:05 Macha2021

Not exactly, I still stuck here, and I don't know which part went wrong. I assume it may be caused by PyGrid does not start a service properly, and the socket went to sleep mode, but I'm confident about this. I actually got a similar error traceback in issue #5521 but this problem is not resolved yet.

LaplaceZhang avatar May 15 '21 21:05 LaplaceZhang

Don't you think it is due to the fact that we launch the server and the client on the same computer ?

Macha2021 avatar May 17 '21 14:05 Macha2021

I think this library can be used for virtual set-up, i.e., place worker and host in one device and use socket to connect the different pipes in localhost.

LaplaceZhang avatar May 26 '21 09:05 LaplaceZhang

@LaplaceZhang i have met the same problem about

[2021-11-25 07:43:19]: 8 DEBUG WebSocket request accepted, switching protocols [2021-11-25 07:43:19]: 8 DEBUG Closed WebSocket [2021-11-25 07:43:19]: 8 DEBUG Failed to write closing frame -> closing socket [2021-11-25 07:43:19]: 8 DEBUG Closed WebSocket

and then

BrokenPipeError: [Errno 32] Broken pipe

do you know how to fix that now ?really appreciate.

SimZD avatar Nov 25 '21 07:11 SimZD

0.5 is no longer supported.

madhavajay avatar Nov 17 '22 07:11 madhavajay