From 89449a0c63d60341af50aa3b2d74e56e3309750a Mon Sep 17 00:00:00 2001 From: Marc Lanctot Date: Wed, 24 Apr 2024 09:03:31 -0230 Subject: [PATCH 1/2] Add warnings to algorithms with known issues. --- open_spiel/python/algorithms/alpha_zero/model.py | 6 ++++++ open_spiel/python/algorithms/deep_cfr_tf2.py | 7 +++++++ open_spiel/python/algorithms/rcfr.py | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/open_spiel/python/algorithms/alpha_zero/model.py b/open_spiel/python/algorithms/alpha_zero/model.py index 4629bc20d6..bf2e1fcf9c 100644 --- a/open_spiel/python/algorithms/alpha_zero/model.py +++ b/open_spiel/python/algorithms/alpha_zero/model.py @@ -21,7 +21,13 @@ import numpy as np import tensorflow.compat.v1 as tf +import warnings +warnings.warn( + "Python AlphaZero has known issues when using Keras 3 and may be " + "removed in a future version unless fixed. See OpenSpiel github " + "issue #1206 for details." +) def cascade(x, fns): for fn in fns: diff --git a/open_spiel/python/algorithms/deep_cfr_tf2.py b/open_spiel/python/algorithms/deep_cfr_tf2.py index 2901822bc6..1f78d5f2d0 100644 --- a/open_spiel/python/algorithms/deep_cfr_tf2.py +++ b/open_spiel/python/algorithms/deep_cfr_tf2.py @@ -34,10 +34,17 @@ import random import numpy as np import tensorflow as tf +import warnings from open_spiel.python import policy import pyspiel +warnings.warn( + "Deep CFR TF2 has known issues when using Keras 3 and may be removed " + "in a future version unless fixed. See OpenSpiel github issue #1208 " + "for details." +) + # The size of the shuffle buffer used to reshuffle part of the data each # epoch within one training iteration diff --git a/open_spiel/python/algorithms/rcfr.py b/open_spiel/python/algorithms/rcfr.py index b427c54aec..12531b48b8 100644 --- a/open_spiel/python/algorithms/rcfr.py +++ b/open_spiel/python/algorithms/rcfr.py @@ -39,10 +39,17 @@ import numpy as np import tensorflow.compat.v1 as tf +import warnings # Temporarily disable TF2 behavior while the code is not updated. tf.disable_v2_behavior() +warnings.warn( + "RCFR has known issues when using Keras 3 and may be removed in a " + "future version unless fixed. See OpenSpiel github issue #1207 for " + "details." +) + def tensor_to_matrix(tensor): """Converts `tensor` to a matrix (a rank-2 tensor) or raises an exception. From 6f9979fdebfd4cee0a91b2a33fa8958c802b777d Mon Sep 17 00:00:00 2001 From: lanctot Date: Thu, 25 Apr 2024 16:46:53 -0230 Subject: [PATCH 2/2] Update rcfr.py --- open_spiel/python/algorithms/rcfr.py | 1 + 1 file changed, 1 insertion(+) diff --git a/open_spiel/python/algorithms/rcfr.py b/open_spiel/python/algorithms/rcfr.py index 12531b48b8..1934b4c061 100644 --- a/open_spiel/python/algorithms/rcfr.py +++ b/open_spiel/python/algorithms/rcfr.py @@ -44,6 +44,7 @@ # Temporarily disable TF2 behavior while the code is not updated. tf.disable_v2_behavior() + warnings.warn( "RCFR has known issues when using Keras 3 and may be removed in a " "future version unless fixed. See OpenSpiel github issue #1207 for "