Upgrade main branch for Python 3.13 and LiteRT#27
Open
DocGarbanzo wants to merge 3 commits intomainfrom
Open
Conversation
## Summary - port the scoped Python 3.13 upgrade work onto a clean branch from `docgarbanzo/main` - add a step-by-step branch plan in `MAIN_PY313_UPGRADE_PLAN.md` - keep the detailed upgrade notes in `PYTHON313_UPGRADE.md` ## Dependency and CI updates - require Python 3.13 in `setup.cfg` - update TensorFlow / tf-keras to the Python 3.13-compatible 2.21 series - switch Pi TFLite runtime dependency to `ai-edge-litert` - update the conda CI workflow to test Python 3.13 ## TensorFlow / Keras compatibility - replace deprecated `tensorflow.python.*` imports with supported `tensorflow.keras.*` and `tf.saved_model.*` APIs - update Keras 3 model save/load expectations and `.keras` handling - adjust Keras training and shape handling for current TensorFlow/Keras behavior - make TensorFlow-dependent code import-safe when TensorFlow is absent ## LiteRT / Pi inference compatibility - add TFLite tensor-API fallback for models without signatures - keep explicit interpreter resolution for `ai-edge-litert` vs full TensorFlow installs - make `output_shapes()` work without TensorFlow installed - harden shape handling for scalar and NumPy integer inputs used during LiteRT inference ## Tests - skip TensorFlow-dependent tests when TensorFlow is not installed - update script and training tests for Keras 3 behavior - run the full suite in the `donkey313` environment ## Validation - `pytest` on `main-py313-upgrade` in `donkey313` - `163 passed, 16 skipped, 1 xfailed` ## Notes - this branch was rebuilt from synced `docgarbanzo/main` and only carries the scoped Python 3.13 / LiteRT upgrade work, not unrelated `dev` changes from `python313-upgrade`
tensorflow-metal has no wheel for Python 3.13, causing installation to fail on macOS. Removing it until Apple ships a compatible release; TF 2.21 will run CPU-only on macOS under Python 3.13. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mainMAIN_PY313_UPGRADE_PLAN.mdandPYTHON313_UPGRADE.mdHighlights
setup.cfg2.21.*ai-edge-literttensorflow.python.*imports with supported APIsoutput_shapes()work without TensorFlow installedValidation
Tested in the
donkey313environment:pytest163 passed, 16 skipped, 1 xfailedNotes
This branch was rebuilt from synced
docgarbanzo/mainand carries only the scoped Python 3.13 / LiteRT upgrade work, without unrelateddevchanges frompython313-upgrade.