diff --git a/open_spiel/python/algorithms/alpha_zero/model.py b/open_spiel/python/algorithms/alpha_zero/model.py index 4629bc20d6..3c84c33c07 100644 --- a/open_spiel/python/algorithms/alpha_zero/model.py +++ b/open_spiel/python/algorithms/alpha_zero/model.py @@ -18,11 +18,19 @@ import functools import os from typing import Sequence +import warnings import numpy as np import tensorflow.compat.v1 as tf +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: x = fn(x) diff --git a/open_spiel/python/algorithms/deep_cfr_tf2.py b/open_spiel/python/algorithms/deep_cfr_tf2.py index 2901822bc6..f085511670 100644 --- a/open_spiel/python/algorithms/deep_cfr_tf2.py +++ b/open_spiel/python/algorithms/deep_cfr_tf2.py @@ -32,6 +32,8 @@ import contextlib import os import random +import warnings + import numpy as np import tensorflow as tf @@ -39,6 +41,13 @@ 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 ADVANTAGE_TRAIN_SHUFFLE_SIZE = 100000 diff --git a/open_spiel/python/algorithms/rcfr.py b/open_spiel/python/algorithms/rcfr.py index b427c54aec..9bae781af6 100644 --- a/open_spiel/python/algorithms/rcfr.py +++ b/open_spiel/python/algorithms/rcfr.py @@ -37,13 +37,23 @@ At Advances in Neural Information Processing Systems 20 (NeurIPS). 2007. """ +import warnings + import numpy as np import tensorflow.compat.v1 as tf + # 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.