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.md referenced 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.0 reference in the TensorFlow/Keras compatibility note (README and docs site) to v1.3.1 — the fixes actually first shipped in v1.3.1, since the v1.3.0 release attempt failed to build and nothing was ever published to PyPI under that version (see the v1.3.1 entry below).

[1.3.1] - 2026-09-12

Fixed

  • 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.

[1.2.1] - 2024-08-18

  • Added setup.py for 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 TeachableMachine class for image classification with exported Keras models.