running the event loop in tf federated

Viewed 236
2 Answers

This sounds like a Jupyter + asyncio issue. See README.md for more information.

  1. Install nest_asyncio.
  2. Use nest_asyncio to patch asyncio.
import nest_asyncio
nest_asyncio.apply()

By design asyncio does not allow its event loop to be nested. This presents a practical problem: When in an environment where the event loop is already running it’s impossible to run tasks and wait for the result. To fix this, run the following code in your Jupyter Notebook:

!pip install --quiet --upgrade --user nest_asyncio

import nest_asyncio
nest_asyncio.apply()

This will solve your problem.

Related