Skip to content

Commit

Permalink
Set os.environ["TF_USE_LEGACY_KERAS"] = "1" in Colab notebooks
Browse files Browse the repository at this point in the history
to guarantee a compatible version of `tf.keras`.

PiperOrigin-RevId: 604380766
  • Loading branch information
arnoegw authored and tensorflower-gardener committed Feb 6, 2024
1 parent ffa453f commit 049d41c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/notebooks/intro_mutag_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"os.environ[\"TF_USE_LEGACY_KERAS\"] = \"1\" # Select tf.keras version 2, not 3.\n",
"import tensorflow as tf\n",
"import tensorflow_gnn as tfgnn\n",
"\n",
Expand Down
1 change: 1 addition & 0 deletions examples/notebooks/ogbn_mag_e2e.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"import re\n",
"from typing import Mapping\n",
"\n",
"os.environ[\"TF_USE_LEGACY_KERAS\"] = \"1\" # Select tf.keras version 2, not 3.\n",
"import tensorflow as tf\n",
"import tensorflow_gnn as tfgnn\n",
"from tensorflow_gnn import runner\n",
Expand Down
1 change: 1 addition & 0 deletions examples/notebooks/ogbn_mag_indepth.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"import re\n",
"\n",
"from google.protobuf import text_format\n",
"os.environ[\"TF_USE_LEGACY_KERAS\"] = \"1\" # Select tf.keras version 2, not 3.\n",
"import tensorflow as tf\n",
"import tensorflow_gnn as tfgnn\n",
"\n",
Expand Down

0 comments on commit 049d41c

Please sign in to comment.