Skip to content

Commit

Permalink
Merge pull request #1213 from google-deepmind:lanctot_v1.5_warnings
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 628371699
Change-Id: I21610382038c80ff498368ec650aba0d23dc85a5
  • Loading branch information
lanctot committed May 13, 2024
2 parents 1208f83 + 6f9979f commit 3258968
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions open_spiel/python/algorithms/alpha_zero/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions open_spiel/python/algorithms/deep_cfr_tf2.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,22 @@
import contextlib
import os
import random
import warnings

import numpy as np
import tensorflow as tf

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
ADVANTAGE_TRAIN_SHUFFLE_SIZE = 100000
Expand Down
10 changes: 10 additions & 0 deletions open_spiel/python/algorithms/rcfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3258968

Please sign in to comment.