Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparation for OpenSpiel 1.5: Add warnings to algorithms with known issues. #1213

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions open_spiel/python/algorithms/alpha_zero/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions open_spiel/python/algorithms/deep_cfr_tf2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions open_spiel/python/algorithms/rcfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,19 @@

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.

Expand Down