You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TensorFlow/Keras 3 compatibility: Teachable Machine's exported .h5 models embed a legacy DepthwiseConv2D layer config ('groups': 1) that current Keras (Keras 3, bundled by default since TensorFlow 2.16) rejects during deserialization, causing model loading to fail with TypeError/ValueError: Unrecognized keyword arguments passed to DepthwiseConv2D: {'groups': 1}. TeachableMachine now loads models with a compatibility shim that discards the unused key, so exported models work on up-to-date TensorFlow/Keras installs without pinning an old TensorFlow version. Fixes #2.
Nested-Sequential .h5 exports fail to load under Keras 3: some Teachable Machine .h5 exports save the model as a Sequential wrapping nested Sequential/Functional submodels. Keras 3's legacy H5 loader mis-rebuilds that shape (a Functional submodel's single output comes back as a length-1 list, which the next layer misreads as two inputs), previously surfacing as a misleading FileNotFoundError: Model file not found. TeachableMachine now falls back to a manual reconstruction that flattens the nested wrappers, rebuilds the graph via the Functional API, and restores weights by matching each layer's name against the saved weight paths.
Prediction annotation crashes on Windows / recent Pillow: show_prediction_on_image() used ImageFont.truetype("DejaVuSans-Bold.ttf", ...), not resolvable by bare name on Windows (OSError), and ImageDraw.textsize(), removed in Pillow 10+. Both are now handled: a ImageFont.load_default() fallback when the named font can't be found, and textbbox() in place of textsize(). Also fixed the highlight box behind the prediction label clipping text descenders (e.g. "g", "%") by measuring the box at the actual draw position instead of reusing an origin-measured extent.
Package build was broken: setup.py reads __version__ from src/__init__.py, but that file was never declared as package data, so it was missing from the sdist. Building the wheel from the sdist (as pypa/gh-action-pypi-publish's two-phase build does) then failed with FileNotFoundError, before any PyPI upload was attempted. Added MANIFEST.in to include it.
Changed
install_requires now specifies tensorflow>=2.16 (previously unpinned, which could silently resolve to a broken combination).
python_requires raised to >=3.9 to match current TensorFlow's supported Python range; removed unsupported 3.7/3.8 classifiers.
requirements.txt (dev/test) updated to current dependency versions and now includes pytest, pytest-mock, and h5py.
Added
Regression tests covering the legacy DepthwiseConv2D config shape, including an end-to-end test that saves a model, tampers its config to reproduce Teachable Machine's legacy export, and verifies it still loads and classifies correctly.
CI workflow to run the test suite on pushes/PRs, and a release workflow to publish to PyPI on tagged GitHub releases.