Skip to content

Remove TF1-based examples (eva.py, exploitability_descent.py)#1455

Merged
lanctot merged 1 commit intogoogle-deepmind:masterfrom
pantha704:cleanup/remove-tf1-examples
Jan 26, 2026
Merged

Remove TF1-based examples (eva.py, exploitability_descent.py)#1455
lanctot merged 1 commit intogoogle-deepmind:masterfrom
pantha704:cleanup/remove-tf1-examples

Conversation

@pantha704
Copy link
Contributor

Summary

Removes TF1-based examples from the open_spiel/python/examples/ directory as requested by @lanctot in #1434.

Changes

  • Deleted eva.py - uses tensorflow.compat.v1
  • Deleted exploitability_descent.py - uses tf.disable_v2_behavior()

Rationale

Per maintainer guidance in #1434:

"Any examples based on TF1 code still lingering in the examples directory (eva, exploitability_descent) should be removed."

A PyTorch version of EVA exists at open_spiel/python/pytorch/eva.py, so the TF1 example removal is safe.

Verification

  • Verified no other files import these examples via grep
  • Clean deletion of 194 lines

Addresses #1434 (partial)

These examples depend on TensorFlow 1.x which is deprecated.
A PyTorch version of EVA exists at open_spiel/python/pytorch/eva.py.

Per maintainer guidance in google-deepmind#1434, TF1-based examples should be removed
in preparation for OpenSpiel 2.0.

Closes google-deepmind#1434 (partial)
@alexunderch
Copy link
Contributor

why only these two....

@lanctot
Copy link
Collaborator

lanctot commented Jan 22, 2026

why only these two....

Agreed. Probably time to drop this whole directory:

https://github.com/google-deepmind/open_spiel/tree/master/open_spiel/python/algorithms/tf

Can we add it to this PR?

@alexunderch
Copy link
Contributor

alexunderch commented Jan 22, 2026

yes, let's get rid of that. I won't back to eva any time soon, almost everything else we have in pytorch/jax or I can re-add it, nothing urgent atp.

then, need to get rid of

export OPEN_SPIEL_PYTHON_TENSORFLOW_DEPS="numpy==1.26.1 tensorflow==2.14.0 tensorflow-probability==0.22.1 tensorflow_datasets==4.9.7 keras==2.14.0"

and https://github.com/google-deepmind/open_spiel/blob/master/open_spiel/scripts/find_tensorflow.sh

I guess that's it!

you may feel sceptical about that, because some components related to tf may be re-added because, per se, of dataset processing with grain, but it would be fine to perform these things with jax stack, and not reintroduce new dependency line

@lanctot
Copy link
Collaborator

lanctot commented Jan 22, 2026

Oh yes, good point!

find_tensorflow.sh can go for sure.

I do believe tensorflow_datasets may still be used somewhere (maybe also tensorflow_probability) but I don't remember exactly. Maybe we can try removing all of those lines and see what happens, and just add back in the ones we still need.

@alexunderch
Copy link
Contributor

Yes, let's try, I tried to remove those deps wherever I could. But still could miss smth. tensorflow_probability is being installed with distrax in the jax stack, so should be all good there.

@alexunderch
Copy link
Contributor

@lanctot, I will aslo need to delete some other tensorflow things that don't break the tests but stay redundant because they were need to be compatible with tf.Sess and models after I am done with refactoring. Should I create a separate PR or we can concentrate on deletion here?

@pantha704
Copy link
Contributor Author

Got it! Since @alexunderch was already working on the broader TF cleanup and refactoring, I'll leave the
algorithms/tf/ directory removal to them to avoid duplicating effort.
Happy to have this PR merged as-is for the examples cleanup, or closed if you'd prefer to consolidate everything in one PR. Let me know what works best!

@lanctot lanctot added imported This PR has been imported and awaiting internal review. Please avoid any more local changes, thanks! merged internally The code is now submitted to our internal repo and will be merged in the next github sync. labels Jan 26, 2026
@lanctot lanctot merged commit 93b1a7e into google-deepmind:master Jan 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

imported This PR has been imported and awaiting internal review. Please avoid any more local changes, thanks! merged internally The code is now submitted to our internal repo and will be merged in the next github sync.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants