Skip to content

Conversation

@psamanoelton
Copy link

Summary

  • Enable building TFQ against TensorFlow 2.16.2 with Bazel 6.5.x
  • Keep Keras 2 (“tf-keras”) path via TF_USE_LEGACY_KERAS=1 to avoid Keras 3 breakages
  • Allow selecting system/venv/conda Python; wire that interpreter through Bazel
  • Make wheel-build script honor chosen Python and include setuptools

Key changes

  • WORKSPACE: bump @org_tensorflow to 2.16.2, add a tiny @python local_repository shim
  • third_party/python_legacy/defs.bzl: export interpreter as a string (what TF’s local_config_python expects)
  • configure.sh: --python= flag; generate .tf_configure.bazelrc + .bazelrc + the python shim
  • .bazelrc: ensure TF_USE_LEGACY_KERAS=1 for build/test; keep existing warnings/rpath tweaks
  • release/build_pip_package.sh: invoke ${PYTHON_BIN_PATH:-python3} and ensure setuptools present
  • setup.py: (optionally) relax deps to run on TF 2.16 (sympy==1.14); extras pin tensorflow==2.16.0

Testing

  • Linux/Ubuntu 22.04 (Docker), Python 3.11, Bazelisk → Bazel 6.5.0
  • bazel build ... release:build_pip_package succeeds
  • Unit tests (scripts/test_all.sh) pass with
  • Wheel installs and imports with TF 2.16.2 + tf-keras 2.16.0, Cirq 1.3.0, NumPy 1.26.4

Notes

  • This keeps TFQ on Keras 2 path; Keras 3 migration can be handled in a a future PR.
  • This changes will help on the incoming upgrades to 2.20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant