diff --git a/examples/notebooks/graph_network_shortest_path.ipynb b/examples/notebooks/graph_network_shortest_path.ipynb index 43a74698..9d6508ab 100644 --- a/examples/notebooks/graph_network_shortest_path.ipynb +++ b/examples/notebooks/graph_network_shortest_path.ipynb @@ -124,7 +124,9 @@ "import collections\n", "import functools\n", "import itertools\n", + "import os\n", "from typing import Callable, Optional, Mapping, Tuple\n", + "os.environ[\"TF_USE_LEGACY_KERAS\"] = \"1\" # For TF2.16+.\n", "\n", "import matplotlib.pyplot as plt\n", "import networkx as nx\n", diff --git a/examples/notebooks/intro_mutag_example.ipynb b/examples/notebooks/intro_mutag_example.ipynb index 2abcf05d..fa02ea2d 100644 --- a/examples/notebooks/intro_mutag_example.ipynb +++ b/examples/notebooks/intro_mutag_example.ipynb @@ -90,7 +90,9 @@ "id": "sS8ot98DEgzJ" }, "source": [ - "Before Python can `import tensorflow_gnn`, the PIP package [`tensorflow-gnn`](https://pypi.org/project/tensorflow-gnn/) needs to be downloaded and installed." + "Before Python can `import tensorflow_gnn`, the PIP package [`tensorflow-gnn`](https://pypi.org/project/tensorflow-gnn/) needs to be downloaded and installed.\n", + "\n", + "TensorFlow 2.16+ must be [configured](https://github.com/tensorflow/gnn/blob/main/tensorflow_gnn/docs/guide/keras_version.md) to use Keras v2 as `tf.keras`." ] }, { @@ -113,6 +115,7 @@ "outputs": [], "source": [ "import os\n", + "os.environ[\"TF_USE_LEGACY_KERAS\"] = \"1\" # For TF2.16+.\n", "\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", diff --git a/examples/notebooks/ogbn_mag_e2e.ipynb b/examples/notebooks/ogbn_mag_e2e.ipynb index ea124352..cb21a7e7 100644 --- a/examples/notebooks/ogbn_mag_e2e.ipynb +++ b/examples/notebooks/ogbn_mag_e2e.ipynb @@ -129,6 +129,7 @@ "import os\n", "import re\n", "from typing import Mapping\n", + "os.environ[\"TF_USE_LEGACY_KERAS\"] = \"1\" # For TF2.16+.\n", "\n", "import tensorflow as tf\n", "import tensorflow_gnn as tfgnn\n", diff --git a/examples/notebooks/ogbn_mag_indepth.ipynb b/examples/notebooks/ogbn_mag_indepth.ipynb index 2e1ca8f4..da5402a9 100644 --- a/examples/notebooks/ogbn_mag_indepth.ipynb +++ b/examples/notebooks/ogbn_mag_indepth.ipynb @@ -126,6 +126,7 @@ "import os\n", "import random\n", "import re\n", + "os.environ[\"TF_USE_LEGACY_KERAS\"] = \"1\" # For TF2.16+.\n", "\n", "from google.protobuf import text_format\n", "import tensorflow as tf\n",