Updates simulation tutorial for Jupyter (workaround for the asyncio bug).
"First, make sure your notebook is connected to a backend that has the relevant\n",
"components (including gRPC dependencies for multi-machine scenarios) compiled.\n",
"\n",
+ "Now, if you are running this notebook in Jupyter, you may need to take an extra\n",
+ "step to work around the\n",
+ "[limitations of Jypter with asyncio](https://github.com/jupyter/notebook/issues/3397#issuecomment-419386811)\n",
+ "by installing the [nest_asyncio](https://github.com/erdewit/nest_asyncio)\n",
+ "package. Uncomment and execute the following lines as needed."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 0,
+ "metadata": {
+ "colab": {},
+ "colab_type": "code",
+ "id": "tnngjncsPq15"
+ },
+ "outputs": [],
+ "source": [
+ "# !python3 -m pip install --user --upgrade nest_asyncio\n",
+ "# import nest_asyncio\n",
+ "# nest_asyncio.apply()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "colab_type": "text",
+ "id": "_zFenI3IPpgI"
+ },
+ "source": [
"Now, let's start by loading the MNIST example from the TFF website, and\n",
"declaring the Python function that will run a small experiment loop. In order\n",
"to use all data and make sure there is enough work for each round, we partition\n",
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": 0,
"metadata": {
"colab": {
"height": 185
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": 0,
"metadata": {
"colab": {
"height": 185
