Skip to content

Upgrade main branch for Python 3.13 and LiteRT#27

Open
DocGarbanzo wants to merge 3 commits intomainfrom
main-py313-upgrade
Open

Upgrade main branch for Python 3.13 and LiteRT#27
DocGarbanzo wants to merge 3 commits intomainfrom
main-py313-upgrade

Conversation

@DocGarbanzo
Copy link
Copy Markdown
Owner

Summary

  • port the scoped Python 3.13 upgrade work onto a clean branch from main
  • update dependencies and CI for Python 3.13
  • add Keras 3 and LiteRT compatibility fixes for TensorFlow and Raspberry Pi inference
  • document the work in MAIN_PY313_UPGRADE_PLAN.md and PYTHON313_UPGRADE.md

Highlights

  • require Python 3.13 in setup.cfg
  • update TensorFlow / tf-keras to 2.21.*
  • switch Pi TFLite runtime dependency to ai-edge-litert
  • replace deprecated tensorflow.python.* imports with supported APIs
  • add TFLite tensor-API fallback for models without signatures
  • make output_shapes() work without TensorFlow installed
  • update tests for Keras 3 behavior and LiteRT-only environments

Validation

Tested in the donkey313 environment:

  • pytest
    • 163 passed, 16 skipped, 1 xfailed

Notes

This branch was rebuilt from synced docgarbanzo/main and carries only the scoped Python 3.13 / LiteRT upgrade work, without unrelated dev changes from python313-upgrade.

DocGarbanzo and others added 3 commits April 13, 2026 21:03
## 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]>
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