Changelog
All notable changes to this project are documented in this file.
[1.3.2] - 2026-09-12
Fixed
- Logo missing on the PyPI project page:
README.mdreferenced the logo with a relative path (logo.png), which GitHub resolves against the repo but PyPI's rendered long description does not, so it showed as a broken image on pypi.org/project/teachable-machine. Switched to an absolute URL (raw.githubusercontent.com). - Corrected a leftover
v1.3.0reference in the TensorFlow/Keras compatibility note (README and docs site) tov1.3.1— the fixes actually first shipped inv1.3.1, since thev1.3.0release attempt failed to build and nothing was ever published to PyPI under that version (see thev1.3.1entry below).
[1.3.1] - 2026-09-12
Fixed
- TensorFlow/Keras 3 compatibility: Teachable Machine's exported
.h5models embed a legacyDepthwiseConv2Dlayer config ('groups': 1) that current Keras (Keras 3, bundled by default since TensorFlow 2.16) rejects during deserialization, causing model loading to fail withTypeError/ValueError: Unrecognized keyword arguments passed to DepthwiseConv2D: {'groups': 1}.TeachableMachinenow 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
.h5exports fail to load under Keras 3: some Teachable Machine.h5exports save the model as aSequentialwrapping nestedSequential/Functionalsubmodels. Keras 3's legacy H5 loader mis-rebuilds that shape (aFunctionalsubmodel's single output comes back as a length-1 list, which the next layer misreads as two inputs), previously surfacing as a misleadingFileNotFoundError: Model file not found.TeachableMachinenow 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()usedImageFont.truetype("DejaVuSans-Bold.ttf", ...), not resolvable by bare name on Windows (OSError), andImageDraw.textsize(), removed in Pillow 10+. Both are now handled: aImageFont.load_default()fallback when the named font can't be found, andtextbbox()in place oftextsize(). 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.pyreads__version__fromsrc/__init__.py, but that file was never declared as package data, so it was missing from the sdist. Building the wheel from the sdist (aspypa/gh-action-pypi-publish's two-phase build does) then failed withFileNotFoundError, before any PyPI upload was attempted. AddedMANIFEST.into include it.
Changed
install_requiresnow specifiestensorflow>=2.16(previously unpinned, which could silently resolve to a broken combination).python_requiresraised to>=3.9to 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 includespytest,pytest-mock, andh5py.
Added
- Regression tests covering the legacy
DepthwiseConv2Dconfig 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.
[1.2.1] - 2024-08-18
- Added
setup.pyfor packaging.
[1.2.0]
- Added package logo, expanded documentation (how-to guide, requirements, code examples), and unit tests.
[1.1] and [1.0]
- Initial releases of the
TeachableMachineclass for image classification with exported Keras models.